From 9a8cc5b2e7d0aa295912e3063caf954a554c3802 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 22 May 2019 23:58:39 +0200 Subject: [PATCH] fixed some NPE --- .../siacs/conversations/ui/ConferenceDetailsActivity.java | 3 +++ .../eu/siacs/conversations/ui/ConversationFragment.java | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java index cc716cea4..48abb03fe 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java @@ -436,6 +436,9 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers private void updateView() { invalidateOptionsMenu(); + if (mConversation == null) { + return; + } final MucOptions mucOptions = mConversation.getMucOptions(); final User self = mucOptions.getSelf(); String account; diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index da7793276..feefbd105 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -2606,7 +2606,12 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke service.sendChatState(conversation); } if (storeNextMessage()) { - runOnUiThread(() -> activity.onConversationsListItemUpdated()); + runOnUiThread(() -> { + if (activity == null) { + return; + } + activity.onConversationsListItemUpdated(); + }); } runOnUiThread(this::updateSendButton); }