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

Commit 690c7e5

Browse files
committed
[android] - verify optional before accessing it
1 parent 4544b7a commit 690c7e5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

platform/android/src/file_source.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,16 @@ void FileSource::resume(jni::JNIEnv&) {
7070

7171
activationCounter.value()++;
7272
if (activationCounter == 1) {
73-
fileSource->resume();
73+
fileSource->resume();
7474
}
7575
}
7676

7777
void FileSource::pause(jni::JNIEnv&) {
78-
activationCounter.value()--;
79-
if (activationCounter == 0) {
80-
fileSource->pause();
78+
if (activationCounter) {
79+
activationCounter.value()--;
80+
if (activationCounter == 0) {
81+
fileSource->pause();
82+
}
8183
}
8284
}
8385

0 commit comments

Comments
 (0)