From 734c5d057125cd5780c46d5803c25b0742e99ea0 Mon Sep 17 00:00:00 2001 From: rebelonion <87634197+rebelonion@users.noreply.github.com> Date: Sun, 21 Jan 2024 00:30:54 -0600 Subject: [PATCH] help clear some pesky errors --- app/src/main/java/ani/dantotsu/Functions.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/ani/dantotsu/Functions.kt b/app/src/main/java/ani/dantotsu/Functions.kt index 3607c6f6..da5b5e1f 100644 --- a/app/src/main/java/ani/dantotsu/Functions.kt +++ b/app/src/main/java/ani/dantotsu/Functions.kt @@ -130,6 +130,13 @@ fun loadData(fileName: String, context: Context? = null, toast: Boolean = tr } } catch (e: Exception) { if (toast) snackString(a?.getString(R.string.error_loading_data, fileName)) + //try to delete the file + try { + a?.deleteFile(fileName) + } catch (e: Exception) { + FirebaseCrashlytics.getInstance().log("Failed to delete file $fileName") + FirebaseCrashlytics.getInstance().recordException(e) + } e.printStackTrace() } return null