mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
Avoid NPE in MessageOpenPgpView.updateLayout()
E/AndroidRuntime(24914): FATAL EXCEPTION: main E/AndroidRuntime(24914): Process: com.fsck.k9, PID: 24914 E/AndroidRuntime(24914): java.lang.NullPointerException E/AndroidRuntime(24914): at org.openintents.openpgp.util.OpenPgpServiceConnection.<init>(OpenPgpServiceConnection.java:35) E/AndroidRuntime(24914): at com.fsck.k9.view.MessageOpenPgpView.updateLayout(MessageOpenPgpView.java:115) E/AndroidRuntime(24914): at com.fsck.k9.view.SingleMessageView.setMessage(SingleMessageView.java:623) E/AndroidRuntime(24914): at com.fsck.k9.fragment.MessageViewFragment$Listener$2.run(MessageViewFragment.java:602) E/AndroidRuntime(24914): at android.os.Handler.handleCallback(Handler.java:733) E/AndroidRuntime(24914): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime(24914): at android.os.Looper.loop(Looper.java:136) E/AndroidRuntime(24914): at android.app.ActivityThread.main(ActivityThread.java:5081) E/AndroidRuntime(24914): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(24914): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime(24914): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) E/AndroidRuntime(24914): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607) E/AndroidRuntime(24914): at dalvik.system.NativeStart.main(Native Method)
This commit is contained in:
parent
f17b45c152
commit
5cc4d7c6a9
@ -17,6 +17,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender.SendIntentException;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
@ -110,8 +111,12 @@ public class MessageOpenPgpView extends LinearLayout {
|
||||
return;
|
||||
}
|
||||
|
||||
FragmentActivity activity = mFragment.getActivity();
|
||||
if (activity == null) {
|
||||
return;
|
||||
}
|
||||
// bind to service
|
||||
mOpenPgpServiceConnection = new OpenPgpServiceConnection(mFragment.getActivity(),
|
||||
mOpenPgpServiceConnection = new OpenPgpServiceConnection(activity,
|
||||
mOpenPgpProvider);
|
||||
mOpenPgpServiceConnection.bindToService();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user