diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2018-03-19 11:19:39 +0100 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2018-03-19 13:11:03 +0100 |
commit | 690c7e58556335220791af156660a65af1fdebd6 (patch) | |
tree | 3174ead48262666f279bfda1610825922ec8e5fe | |
parent | 4544b7aae9ab96ff89f3e46a1ee38ce0af95054f (diff) | |
download | qtlocation-mapboxgl-690c7e58556335220791af156660a65af1fdebd6.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(); + } } } |