From c88ed1ff2cf47f791bfd677a3bf17729e707cfb5 Mon Sep 17 00:00:00 2001 From: Aleksandr Popovich Date: Sun, 13 Jul 2025 20:14:07 -0400 Subject: [PATCH] [android] Fix crash caused by unreferenced driver Previously, if the user selected a per-game driver and that driver was deleted from the global menu, it would cause a crash, it was because of a mismatch between FileNotFoundException and NoSuchFileException. To avoid the inconsistency I just made the check for if a file exists or not to be separate. Signed-off-by: Aleksandr Popovich --- .../src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverHelper.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverHelper.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverHelper.kt index 81943e9235..3a7a80001c 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverHelper.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverHelper.kt @@ -177,6 +177,10 @@ object GpuDriverHelper { * @return A non-null [GpuDriverMetadata] instance that may have null members */ fun getMetadataFromZip(driver: File): GpuDriverMetadata { + if (!driver.exists()) { + return GpuDriverMetadata() + } + try { ZipFile(driver).use { zf -> val entries = zf.entries()