forked from github/cordova-android
Corrected check for existence of accelerometer timer to allow clearWatch to clearInterval correctly.
This commit is contained in:
parent
297ddb99fe
commit
668bc9e0ca
@ -102,7 +102,7 @@ Accelerometer.prototype.watchAcceleration = function(successCallback, errorCallb
|
||||
Accelerometer.prototype.clearWatch = function(id) {
|
||||
|
||||
// Stop javascript timer & remove from timer list
|
||||
if (id && navigator.accelerometer.timers[id]) {
|
||||
if (id && navigator.accelerometer.timers[id] != undefined) {
|
||||
clearInterval(navigator.accelerometer.timers[id]);
|
||||
delete navigator.accelerometer.timers[id];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user