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

Verify optional before accessing its value #11480

Merged
merged 1 commit into from
Mar 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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