aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-04-19 19:11:32 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-04-19 19:11:32 +0200
commit9e20a4936e3bea938e20e15421985ea1a928bf63 (patch)
tree5ae9014019963aeaec16f0afa0174f08aaf4cf52 /src/main/java
parent570a22206dd1588ac2bff0e950a48befa0daef82 (diff)
some code clean up to fix some rare NPE’s
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java8
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java3
2 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index a44311b4..e5389dd6 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -929,10 +929,10 @@ public class ConversationActivity extends XmppActivity
}
private void handleViewConversationIntent(final Intent intent) {
- final String uuid = (String) intent.getExtras().get(CONVERSATION);
- final String downloadUuid = (String) intent.getExtras().get(MESSAGE);
- final String text = intent.getExtras().getString(TEXT, "");
- final String nick = intent.getExtras().getString(NICK, null);
+ final String uuid = intent.getStringExtra(CONVERSATION);
+ final String downloadUuid = intent.getStringExtra(MESSAGE);
+ final String text = intent.getStringExtra(TEXT);
+ final String nick = intent.getStringExtra(NICK);
if (selectConversationByUuid(uuid)) {
this.mConversationFragment.reInit(getSelectedConversation());
if (nick != null) {
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index a3a02b27..bb349348 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -1019,6 +1019,9 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
}
public void appendText(String text) {
+ if (text == null) {
+ return;
+ }
String previous = this.mEditMessage.getText().toString();
if (previous.length() != 0 && !previous.endsWith(" ")) {
text = " " + text;