summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2018-03-19 11:19:39 +0100
committerTobrun <tobrun@mapbox.com>2018-03-19 15:10:15 +0100
commitc5075e33ec1c5024da5d583717c1626f8f243f24 (patch)
tree6967c775eea3778f62a51bd5bccc7227f281b381
parent7d5304ebc121711d9b2571e7b6fb8a184a39d5af (diff)
downloadqtlocation-mapboxgl-c5075e33ec1c5024da5d583717c1626f8f243f24.tar.gz
[android] - verify optional before accessing it
-rw-r--r--platform/android/src/file_source.cpp10
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();
+ }
}
}