diff --git a/src/com/fsck/k9/view/MessageOpenPgpView.java b/src/com/fsck/k9/view/MessageOpenPgpView.java index d2a00d09c..dd2cbb40b 100644 --- a/src/com/fsck/k9/view/MessageOpenPgpView.java +++ b/src/com/fsck/k9/view/MessageOpenPgpView.java @@ -381,7 +381,11 @@ public class MessageOpenPgpView extends LinearLayout { } private void handleError(final OpenPgpError error) { - mFragment.getActivity().runOnUiThread(new Runnable() { + Activity activity = mFragment.getActivity(); + if (activity == null) { + return; + } + activity.runOnUiThread(new Runnable() { @Override public void run() {