summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVyacheslav Koscheev <vok1980@gmail.com>2017-10-23 19:50:46 +0700
committerAlex Blasche <alexander.blasche@qt.io>2017-10-24 06:08:55 +0000
commitb97f3e0a984eabf0fa1a991b636ea967f6a9a2c4 (patch)
treed8caabcd6ade48dbd75f327aa5e08c12335265f7
parente9a42b7cfcbc5fc8a544d57a71316b922aeda271 (diff)
downloadqtlocation-b97f3e0a984eabf0fa1a991b636ea967f6a9a2c4.tar.gz
Android: check positioning listener not null
Change-Id: I8b491dc1a3b9056c9a15d6814b72e52e37132dda Reviewed-by: Sergey A. Galin <s.galin@2gis.ru> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/plugins/position/android/jar/src/org/qtproject/qt5/android/positioning/QtPositioning.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/position/android/jar/src/org/qtproject/qt5/android/positioning/QtPositioning.java b/src/plugins/position/android/jar/src/org/qtproject/qt5/android/positioning/QtPositioning.java
index edc39bd7..1ea0c071 100644
--- a/src/plugins/position/android/jar/src/org/qtproject/qt5/android/positioning/QtPositioning.java
+++ b/src/plugins/position/android/jar/src/org/qtproject/qt5/android/positioning/QtPositioning.java
@@ -229,8 +229,11 @@ public class QtPositioning implements LocationListener
static private void removeActiveListener(int androidClassKey)
{
QtPositioning listener = runningListeners.remove(androidClassKey);
- locationManager.removeUpdates(listener);
- listener.setActiveLooper(false);
+
+ if (listener != null) {
+ locationManager.removeUpdates(listener);
+ listener.setActiveLooper(false);
+ }
}