Avoid NPE by checking if mNetworkMode is null

Change-Id: Ib860289e2ef57acf4e2e83fed44298d0a73751a3