incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From macdo...@apache.org
Subject [3/3] android commit: Guard against NullPointerException in Compasslistenter
Date Wed, 24 Oct 2012 20:32:17 GMT
Guard against NullPointerException in Compasslistenter


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/652f15f8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/652f15f8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/652f15f8

Branch: refs/heads/master
Commit: 652f15f8937683649c7e353c39eadbb5591ab0dc
Parents: cba0d59
Author: Simon MacDonald <simon.macdonald@gmail.com>
Authored: Wed Oct 24 16:29:02 2012 -0400
Committer: Simon MacDonald <simon.macdonald@gmail.com>
Committed: Wed Oct 24 16:29:02 2012 -0400

----------------------------------------------------------------------
 .../src/org/apache/cordova/CompassListener.java    |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/652f15f8/framework/src/org/apache/cordova/CompassListener.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CompassListener.java b/framework/src/org/apache/cordova/CompassListener.java
index 7e783b9..401e053 100755
--- a/framework/src/org/apache/cordova/CompassListener.java
+++ b/framework/src/org/apache/cordova/CompassListener.java
@@ -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.");
+            }
         }
     }
 


Mime
View raw message