Bug 1130052 - Try avoid NPE, return from onHandleIntent if null intent. r=vng, a=sledru
authorGarvan Keeley <gkeeley@mozilla.com>
Fri, 06 Feb 2015 13:30:31 -0800
changeset 249638 7b7838347d18b37848c08260ce1c28e1ebb8428a
parent 249637 6c0b609839b118891c9256591914a4ef9f27302b
child 249639 257d30d69d988420423f6130a8e3bd44c513df38
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvng, sledru
bugs1130052
milestone37.0a2
Bug 1130052 - Try avoid NPE, return from onHandleIntent if null intent. r=vng, a=sledru
mobile/android/stumbler/java/org/mozilla/mozstumbler/service/uploadthread/UploadAlarmReceiver.java
--- a/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/uploadthread/UploadAlarmReceiver.java
+++ b/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/uploadthread/UploadAlarmReceiver.java
@@ -43,18 +43,20 @@ public class UploadAlarmReceiver extends
         }
 
         public UploadAlarmService() {
             super(LOG_TAG);
         }
 
         @Override
         protected void onHandleIntent(Intent intent) {
-            // Default to a repeating alarm, which is what Fennec Stumbler uses
-            boolean isRepeating = (intent == null)? true : intent.getBooleanExtra(EXTRA_IS_REPEATING, true);
+            if (intent == null) {
+                return;
+            }
+            boolean isRepeating = intent.getBooleanExtra(EXTRA_IS_REPEATING, true);
             if (DataStorageManager.getInstance() == null) {
                 DataStorageManager.createGlobalInstance(this, null);
             }
             upload(isRepeating);
         }
 
         void upload(boolean isRepeating) {
             if (!isRepeating) {