From ec9f0d18dc47eba0fb36297406ee510e3486dd99 Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Mon, 20 Aug 2012 11:22:24 -0400 Subject: [PATCH] Added an else block to prevent a null pointer in RingerProcessingService.onStartCommand() closes #145 --- LocationRinger/AndroidManifest.xml | 4 ++-- .../services/RingerProcessingService.java | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/LocationRinger/AndroidManifest.xml b/LocationRinger/AndroidManifest.xml index 5706afc..bbac404 100644 --- a/LocationRinger/AndroidManifest.xml +++ b/LocationRinger/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="154" + android:versionName="7d75bb1" > diff --git a/LocationRinger/src/com/TwentyCodes/android/LocationRinger/services/RingerProcessingService.java b/LocationRinger/src/com/TwentyCodes/android/LocationRinger/services/RingerProcessingService.java index 0a884c3..a901bd9 100644 --- a/LocationRinger/src/com/TwentyCodes/android/LocationRinger/services/RingerProcessingService.java +++ b/LocationRinger/src/com/TwentyCodes/android/LocationRinger/services/RingerProcessingService.java @@ -232,14 +232,15 @@ public class RingerProcessingService extends Service { if(intent == null) stopSelf(startId); - - if (intent.getParcelableExtra(LocationLibraryConstants.INTENT_EXTRA_LOCATION_CHANGED) != null) { - mLocation = intent.getParcelableExtra(LocationLibraryConstants.INTENT_EXTRA_LOCATION_CHANGED); - processRingers(); - } else { - if (Debug.DEBUG) - Log.d(TAG, "Location was null"); - stopSelf(startId); + else { + if (intent.getParcelableExtra(LocationLibraryConstants.INTENT_EXTRA_LOCATION_CHANGED) != null) { + mLocation = intent.getParcelableExtra(LocationLibraryConstants.INTENT_EXTRA_LOCATION_CHANGED); + processRingers(); + } else { + if (Debug.DEBUG) + Log.d(TAG, "Location was null"); + stopSelf(startId); + } } return super.onStartCommand(intent, flags, startId); }