diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2018-03-19 11:19:39 +0100 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2018-03-19 15:10:15 +0100 |
commit | c5075e33ec1c5024da5d583717c1626f8f243f24 (patch) | |
tree | 6967c775eea3778f62a51bd5bccc7227f281b381 | |
parent | 7d5304ebc121711d9b2571e7b6fb8a184a39d5af (diff) | |
download | qtlocation-mapboxgl-c5075e33ec1c5024da5d583717c1626f8f243f24.tar.gz |
[android] - verify optional before accessing it
-rw-r--r-- | platform/android/src/file_source.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/platform/android/src/file_source.cpp b/platform/android/src/file_source.cpp index 612619a30b..d8d715dbd3 100644 --- a/platform/android/src/file_source.cpp +++ b/platform/android/src/file_source.cpp @@ -70,14 +70,16 @@ void FileSource::resume(jni::JNIEnv&) { activationCounter.value()++; if (activationCounter == 1) { - fileSource->resume(); + fileSource->resume(); } } void FileSource::pause(jni::JNIEnv&) { - activationCounter.value()--; - if (activationCounter == 0) { - fileSource->pause(); + if (activationCounter) { + activationCounter.value()--; + if (activationCounter == 0) { + fileSource->pause(); + } } } |