File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
app/src/main/java/io/github/fate_grand_automata/runner Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -53,11 +53,15 @@ class ScreenshotServiceHolder @Inject constructor(
5353 throw IllegalStateException (" Media projection token is null" )
5454 }
5555 val token = if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .UPSIDE_DOWN_CAKE ) {
56- ScriptRunnerService .mediaProjectionToken
56+ ScriptRunnerService .mediaProjectionToken!!
5757 } else {
58- // Cloning the Intent allows reuse.
59- // Otherwise, the Intent gets consumed and MediaProjection cannot be started multiple times.
60- ScriptRunnerService .mediaProjectionToken.clone() as Intent
58+ try {
59+ // Cloning the Intent allows reuse.
60+ // Otherwise, the Intent gets consumed and MediaProjection cannot be started multiple times.
61+ ScriptRunnerService .mediaProjectionToken?.clone() as Intent
62+ } catch (e: Exception ) {
63+ ScriptRunnerService .mediaProjectionToken!!
64+ }
6165 }
6266
6367 val mediaProjection =
You can’t perform that action at this time.
0 commit comments