mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
Guard against NullPointerException in Compasslistenter
This commit is contained in:
parent
cba0d59021
commit
652f15f893
@ -202,7 +202,9 @@ public class CompassListener extends CordovaPlugin implements SensorEventListene
|
||||
private void timeout() {
|
||||
if (this.status == CompassListener.STARTING) {
|
||||
this.setStatus(CompassListener.ERROR_FAILED_TO_START);
|
||||
this.callbackContext.error("Compass listener failed to start.");
|
||||
if (this.callbackContext != null) {
|
||||
this.callbackContext.error("Compass listener failed to start.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user