From 0c7d4825cc46cd0764da80aedff3f093c340d330 Mon Sep 17 00:00:00 2001 From: cketti Date: Sun, 11 Jul 2010 14:57:00 +0000 Subject: [PATCH] Avoid NullPointerException when trying to move a message before it is fully loaded (in message view). Fixes issue 1957 --- src/com/fsck/k9/activity/MessageView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index da9518f27..9b61176ab 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -1195,7 +1195,8 @@ public class MessageView extends K9Activity implements OnClickListener private void onMove() { - if (MessagingController.getInstance(getApplication()).isMoveCapable(mAccount) == false) + if ((MessagingController.getInstance(getApplication()).isMoveCapable(mAccount) == false) + || (mMessage == null)) { return; } @@ -1215,7 +1216,8 @@ public class MessageView extends K9Activity implements OnClickListener private void onCopy() { - if (MessagingController.getInstance(getApplication()).isCopyCapable(mAccount) == false) + if ((MessagingController.getInstance(getApplication()).isCopyCapable(mAccount) == false) + || (mMessage == null)) { return; }