fix clipboard null crash

This commit is contained in:
Ashley Hughes 2014-01-15 22:37:23 +00:00
parent 9c0432d24c
commit 09caba36a0
2 changed files with 6 additions and 4 deletions

View file

@ -50,7 +50,7 @@ public class ClipboardReflection {
methodNewPlainText.invoke(clipboard, clip);
}
} catch (Exception e) {
Log.e("ProjectsException", "There was and error copying the text to the clipboard: "
Log.e("ProjectsException", "There was an error copying the text to the clipboard: "
+ e.getMessage());
}
}
@ -89,7 +89,7 @@ public class ClipboardReflection {
return null;
}
} catch (Exception e) {
Log.e("ProjectsException", "There was and error getting the text from the clipboard: "
Log.e("ProjectsException", "There was an error getting the text from the clipboard: "
+ e.getMessage());
return null;

View file

@ -59,8 +59,10 @@ public class ImportKeysClipboardFragment extends Fragment {
@Override
public void onClick(View v) {
CharSequence clipboardText = ClipboardReflection.getClipboardText(getActivity());
mImportActivity.loadCallback(clipboardText.toString().getBytes(), null);
String sendText = "";
if (clipboardText != null)
sendText = clipboardText.toString();
mImportActivity.loadCallback(sendText.getBytes(), null);
}
});