From b12df7d5b0ff78bf897ccc0eafa0d7a6b3807538 Mon Sep 17 00:00:00 2001 From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> Date: Tue, 1 Dec 2026 09:04:32 +0530 Subject: [PATCH] fix(sdcard): stop crash when deleting without SAF permission DocumentsContract.deleteDocument throws SecurityException when the app no longer holds a grant for the document. delete only caught FileNotFoundException, so the exception escaped the worker thread and killed the app. Report it through the error callback instead. --- .../app/src/main/java/com/foxdebug/acode/sdcard/SDcard.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/android/app/src/main/java/com/foxdebug/acode/sdcard/SDcard.java b/platforms/android/app/src/main/java/com/foxdebug/acode/sdcard/SDcard.java index 5e902b4eb..7643343ba 100644 --- a/platforms/android/app/src/main/java/com/foxdebug/acode/sdcard/SDcard.java +++ b/platforms/android/app/src/main/java/com/foxdebug/acode/sdcard/SDcard.java @@ -795,7 +795,7 @@ public void run() { } else { callback.error("Unable to delete file " + filename); } - } catch (FileNotFoundException e) { + } catch (FileNotFoundException | RuntimeException e) { callback.error(e.toString()); } }