Skip to content

Commit ad14b11

Browse files
committed
Issue #169: Added check to make sure that we have the wake lock before tying to release it
Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
1 parent 1e3cd8b commit ad14b11

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • org.eclipse.paho.android.service/org.eclipse.paho.android.service/src/main/java/org/eclipse/paho/android/service

org.eclipse.paho.android.service/org.eclipse.paho.android.service/src/main/java/org/eclipse/paho/android/service/AlarmPingSender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public void onFailure(IMqttToken asyncActionToken,
161161
}
162162
});
163163

164-
if (token == null) {
164+
if (token == null && wakelock.isHeld()) {
165165
wakelock.release();
166166
}
167167
}

0 commit comments

Comments
 (0)