Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] - verify optional before accessing it
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun committed Mar 19, 2018
1 parent 4544b7a commit 690c7e5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions platform/android/src/file_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}

Expand Down

0 comments on commit 690c7e5

Please sign in to comment.