We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc3f0e9 commit a6b8494Copy full SHA for a6b8494
android/src/main/java/com/reactnativestripesdk/utils/KeepJsAwakeTask.kt
@@ -33,7 +33,14 @@ internal class KeepJsAwakeTask(
33
fun stop() {
34
val taskId = taskId ?: return
35
val headlessJsTaskContext = HeadlessJsTaskContext.getInstance(context)
36
- headlessJsTaskContext.finishTask(taskId)
37
- this.taskId = null
+
+ try {
38
+ headlessJsTaskContext.finishTask(taskId)
39
+ } catch (e: AssertionError) {
40
+ // Ignore if task already finished
41
+ // Log.w("KeepJsAwakeTask", "Tried to stop a non-existent task (id=$taskId)")
42
+ } finally {
43
+ this.taskId = null
44
+ }
45
}
46
0 commit comments