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

Commit 1b2a1509 authored by Michael W's avatar Michael W Committed by Gerrit Code Review
Browse files

isRoaming: fix possible NPE

Looks like isRoaming() is called with
mServiceState being null sometimes
Check for non null as well

(Reference:
BugReport 13-20160520-26 L #36)

Change-Id: I90a7feb2f5b72a4b94bbb4e7a5c4f486b416143b
parent 3d98dae9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -279,13 +279,15 @@ public class MobileSignalController extends SignalController<
    }

    private boolean isRoaming() {
        if (isCdma()) {
        if (mServiceState == null) {
            return false;
        } else if (isCdma()) {
            final int iconMode = mServiceState.getCdmaEriIconMode();
            return mServiceState.getCdmaEriIconIndex() != EriInfo.ROAMING_INDICATOR_OFF
                    && (iconMode == EriInfo.ROAMING_ICON_MODE_NORMAL
                        || iconMode == EriInfo.ROAMING_ICON_MODE_FLASH);
        } else {
            return mServiceState != null && mServiceState.getRoaming();
            return mServiceState.getRoaming();
        }
    }