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

Commit 31e19f34 authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

Don't attempt to stop the receive thread if we never started it.

If socket initialization fails, DhcpState#exit will call
mReceiveThread#stop and crash the system with an NPE. Make sure
we don't do that if mReceiveThread is null, and properly null it
out when exiting.

Bug: 23088314
Change-Id: I4378d8280f9d8588f5eaa8bd7ade61beab1c3ce2
parent c00b1067
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -603,7 +603,10 @@ public class DhcpClient extends BaseDhcpStateMachine {
        @Override
        public void exit() {
            cancelOneshotTimeout();
            if (mReceiveThread != null) {
                mReceiveThread.halt();  // Also closes sockets.
                mReceiveThread = null;
            }
            clearDhcpState();
        }