Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc92b9c3 authored by Miranda Kephart's avatar Miranda Kephart
Browse files

Fix NPE in ScreenshotHelper

Check for null before unbinding the screenshot process.

Test: manual
Bug: 155726862
Change-Id: Ica1cc521b6a510b5e15e42e1e2a87ebf613a53aa
parent 331ac296
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -132,6 +132,7 @@ public class ScreenshotHelper {
                    }
                };
    }

    private static final String TAG = "ScreenshotHelper";

    // Time until we give up on the screenshot & show an error instead.
@@ -146,8 +147,6 @@ public class ScreenshotHelper {
        mContext = context;
    }



    /**
     * Request a screenshot be taken.
     *
@@ -284,8 +283,8 @@ public class ScreenshotHelper {
                            break;
                        case SCREENSHOT_MSG_PROCESS_COMPLETE:
                            synchronized (mScreenshotLock) {
                                if (mScreenshotConnection == myConn) {
                                    mContext.unbindService(mScreenshotConnection);
                                if (myConn != null && mScreenshotConnection == myConn) {
                                    mContext.unbindService(myConn);
                                    mScreenshotConnection = null;
                                    mScreenshotService = null;
                                }