fix NPE from reading UI thread data

Phillip Davis created

`onTextDeleted` is called from a single-threaded executor. the zero-arg
overload of `storeNextMessage` reads from the `EditMessage` component,
but `onTextDeleted` should obviously never read a non-null message, so
there's no reason to coordinate it with the UI thread.

Change summary

src/main/java/eu/siacs/conversations/ui/ConversationFragment.java | 16 
1 file changed, 7 insertions(+), 9 deletions(-)

Detailed changes

src/main/java/eu/siacs/conversations/ui/ConversationFragment.java 🔗

@@ -4641,16 +4641,14 @@ public class ConversationFragment extends XmppFragment
                 && conversation.setOutgoingChatState(Config.DEFAULT_CHAT_STATE)) {
             service.sendChatState(conversation);
         }
-        if (storeNextMessage()) {
-            runOnUiThread(
-                    () -> {
-                        if (activity == null) {
-                            return;
-                        }
+        final boolean stored = storeNextMessage(null);
+        runOnUiThread(
+                () -> {
+                    if (stored && activity != null) {
                         activity.onConversationsListItemUpdated();
-                    });
-        }
-        runOnUiThread(this::updateSendButton);
+                    }
+                    updateSendButton();
+                });
     }
 
     @Override