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

Commit 8bdd2a49 authored by Paul Jensen's avatar Paul Jensen Committed by Android Git Automerger
Browse files

am ffe2dda1: Merge "Avoid NPE when sendMessage is called after disconnect." into mnc-dev

* commit 'ffe2dda1':
  Avoid NPE when sendMessage is called after disconnect.
parents 94d3164f ffe2dda1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -462,10 +462,8 @@ public class AsyncChannel {
        } catch(Exception e) {
        }
        // Tell source we're disconnected.
        if (mSrcHandler != null) {
        replyDisconnected(STATUS_SUCCESSFUL);
        mSrcHandler = null;
        }
        // Unlink only when bindService isn't used
        if (mConnection == null && mDstMessenger != null && mDeathMonitor!= null) {
            mDstMessenger.getBinder().unlinkToDeath(mDeathMonitor, 0);
@@ -871,6 +869,8 @@ public class AsyncChannel {
     * @param status to be stored in msg.arg1
     */
    private void replyDisconnected(int status) {
        // Can't reply if already disconnected. Avoid NullPointerException.
        if (mSrcHandler == null) return;
        Message msg = mSrcHandler.obtainMessage(CMD_CHANNEL_DISCONNECTED);
        msg.arg1 = status;
        msg.obj = this;