Skip to content

Commit

Permalink
Null check on Pending Intent In AlarmPingSender
Browse files Browse the repository at this point in the history
  • Loading branch information
jpwsutton authored Dec 8, 2016
1 parent 6579bf4 commit 66eea50
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ public void stop() {

Log.d(TAG, "Unregister alarmreceiver to MqttService"+comms.getClient().getClientId());
if(hasStarted){
// Cancel Alarm.
AlarmManager alarmManager = (AlarmManager) service.getSystemService(Service.ALARM_SERVICE);
alarmManager.cancel(pendingIntent);
if(pendingIntent != null){
// Cancel Alarm.
AlarmManager alarmManager = (AlarmManager) service.getSystemService(Service.ALARM_SERVICE);
alarmManager.cancel(pendingIntent);
}

hasStarted = false;
try{
Expand Down

0 comments on commit 66eea50

Please sign in to comment.