From 2be7df287a65d9185dbfc2f3b68cf09775efd874 Mon Sep 17 00:00:00 2001 From: Aleksandr Popovich Date: Mon, 14 Jul 2025 02:18:33 +0200 Subject: [PATCH] [android] Fix crash caused by unreferenced driver (#58) 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 Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/58 Co-authored-by: Aleksandr Popovich Co-committed-by: Aleksandr Popovich --- .../main/java/org/yuzu/yuzu_emu/utils/GpuDriverHelper.kt | 7 +++++++ 1 file changed, 7 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..99f7fd81fe 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 @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -177,6 +180,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()