diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-04-22 09:13:21 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-04-22 09:13:21 +0200 |
commit | 93cf923348a2d5992a201b51b292bfe8280e9d1d (patch) | |
tree | 44e0a88a44accdb27cccb446d925e20b54b9770d /src/main/java/de/pixart/messenger/ui | |
parent | a1220ce412116659f1b1f04340f9614226fceee0 (diff) |
fix crash in resendMessage
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 16 |
2 files changed, 4 insertions, 14 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 7dc0697db..8a1db5736 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -1840,7 +1840,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke } public void resendMessage(final Message message) { - if (message.isFileOrImage()) { + if (message != null && message.isFileOrImage()) { DownloadableFile file = activity.xmppConnectionService.getFileBackend().getFile(message); if (file.exists()) { final Conversation conversation = message.getConversation(); diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java index 3eba89ffe..0b464e096 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java @@ -36,7 +36,6 @@ import android.view.ActionMode; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.WindowManager; import android.widget.ArrayAdapter; @@ -72,8 +71,8 @@ import de.pixart.messenger.persistance.FileBackend; import de.pixart.messenger.services.AudioPlayer; import de.pixart.messenger.services.MessageArchiveService; import de.pixart.messenger.services.NotificationService; -import de.pixart.messenger.ui.ConversationsActivity; import de.pixart.messenger.ui.ConversationFragment; +import de.pixart.messenger.ui.ConversationsActivity; import de.pixart.messenger.ui.ShowFullscreenMessageActivity; import de.pixart.messenger.ui.XmppActivity; import de.pixart.messenger.ui.text.DividerSpan; @@ -336,14 +335,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie } viewHolder.resend_button.setText(R.string.send_again); viewHolder.resend_button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_resend_grey600_48dp, 0, 0, 0); - viewHolder.resend_button.setOnClickListener(new OnClickListener() { - final Message mMessage = message; - - @Override - public void onClick(View v) { - mConversationFragment.resendMessage(mMessage); - } - }); + viewHolder.resend_button.setOnClickListener(v -> mConversationFragment.resendMessage(message)); } else if (!error && type == SENT) { viewHolder.resend_button.setVisibility(View.GONE); if (darkBackground) { @@ -365,9 +357,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie } else { boolean verified = false; if (message.getEncryption() == Message.ENCRYPTION_AXOLOTL) { - final FingerprintStatus status = message.getConversation() - .getAccount().getAxolotlService().getFingerprintTrust( - message.getFingerprint()); + final FingerprintStatus status = message.getConversation().getAccount().getAxolotlService().getFingerprintTrust(message.getFingerprint()); if (status != null && status.isVerified()) { verified = true; } |