Added an else block to prevent a null pointer in

RingerProcessingService.onStartCommand()

closes #145
This commit is contained in:
2012-08-20 11:22:24 -04:00
parent 7d75bb162d
commit ec9f0d18dc
2 changed files with 11 additions and 10 deletions

View File

@@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.TwentyCodes.android.LocationRinger"
android:installLocation="internalOnly"
android:versionCode="152"
android:versionName="d36c436" >
android:versionCode="154"
android:versionName="7d75bb1" >
<uses-sdk android:minSdkVersion="7"/>

View File

@@ -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);
}