зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1095914 - Fix NPE due to no telephony manager. r=vng
https://github.com/mozilla/MozStumbler/pull/1194 1185 NPE Reporter.startup (no telephony manager)
This commit is contained in:
Родитель
53995c07d7
Коммит
4e4b118fd8
|
@ -63,7 +63,12 @@ public final class Reporter extends BroadcastReceiver {
|
|||
|
||||
mContext = context.getApplicationContext();
|
||||
TelephonyManager tm = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
mPhoneType = tm.getPhoneType();
|
||||
if (tm != null) {
|
||||
mPhoneType = tm.getPhoneType();
|
||||
} else {
|
||||
Log.d(LOG_TAG, "No telephony manager.");
|
||||
mPhoneType = TelephonyManager.PHONE_TYPE_NONE;
|
||||
}
|
||||
|
||||
mIsStarted = true;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче