aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-07-16 13:14:51 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-07-16 13:14:51 +0200
commitb477b8f57b8af31879ba2c5c55693d86a55725e6 (patch)
treeb720b615b06cc8f3865102db6feeaaef3fb248ec /src/main/java/eu
parent2fa9af735bb9f4eefeffa8f354a851ce150d2fec (diff)
fixed some npes
Diffstat (limited to 'src/main/java/eu')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java15
1 files changed, 11 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 a488e3f2..96abf65b 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -1073,6 +1073,9 @@ public class ConversationActivity extends XmppActivity
}
private void attachLocationToConversation(Conversation conversation, Uri uri) {
+ if (conversation == null) {
+ return;
+ }
xmppConnectionService.attachLocationToConversation(conversation,uri, new UiCallback<Message>() {
@Override
@@ -1093,8 +1096,10 @@ public class ConversationActivity extends XmppActivity
}
private void attachFileToConversation(Conversation conversation, Uri uri) {
- prepareFileToast = Toast.makeText(getApplicationContext(),
- getText(R.string.preparing_file), Toast.LENGTH_LONG);
+ if (conversation == null) {
+ return;
+ }
+ prepareFileToast = Toast.makeText(getApplicationContext(),getText(R.string.preparing_file), Toast.LENGTH_LONG);
prepareFileToast.show();
xmppConnectionService.attachFileToConversation(conversation,uri, new UiCallback<Message>() {
@Override
@@ -1116,8 +1121,10 @@ public class ConversationActivity extends XmppActivity
}
private void attachImageToConversation(Conversation conversation, Uri uri) {
- prepareFileToast = Toast.makeText(getApplicationContext(),
- getText(R.string.preparing_image), Toast.LENGTH_LONG);
+ if (conversation == null) {
+ return;
+ }
+ prepareFileToast = Toast.makeText(getApplicationContext(),getText(R.string.preparing_image), Toast.LENGTH_LONG);
prepareFileToast.show();
xmppConnectionService.attachImageToConversation(conversation, uri,
new UiCallback<Message>() {