From 24a51d87155ff69b896cbf6e6a6e57e6fb943dbd Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 23 Feb 2019 10:24:08 +0100 Subject: [PATCH] do null check before splitting error message for processing --- .../eu/siacs/conversations/ui/adapter/MessageAdapter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java index 5b9e8c04a..b6324c510 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -222,7 +222,7 @@ public class MessageAdapter extends ArrayAdapter implements CopyTextVie final String errorMessage = message.getErrorMessage(); if (Message.ERROR_MESSAGE_CANCELLED.equals(errorMessage)) { info = getContext().getString(R.string.cancelled); - } else { + } else if (errorMessage != null) { final String[] errorParts = errorMessage.split("\\u001f", 2); if (errorParts.length == 2) { switch (errorParts[0]) { @@ -236,6 +236,8 @@ public class MessageAdapter extends ArrayAdapter implements CopyTextVie } else { info = getContext().getString(R.string.send_failed); } + } else { + info = getContext().getString(R.string.send_failed); } error = true; break;