[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 <popovich@eden-emu.dev>
This commit is contained in:
Aleksandr Popovich 2025-07-13 20:14:07 -04:00
parent 492903cc7a
commit c88ed1ff2c
No known key found for this signature in database
GPG key ID: B2008BBDA7954884

View file

@ -177,6 +177,10 @@ object GpuDriverHelper {
* @return A non-null [GpuDriverMetadata] instance that may have null members * @return A non-null [GpuDriverMetadata] instance that may have null members
*/ */
fun getMetadataFromZip(driver: File): GpuDriverMetadata { fun getMetadataFromZip(driver: File): GpuDriverMetadata {
if (!driver.exists()) {
return GpuDriverMetadata()
}
try { try {
ZipFile(driver).use { zf -> ZipFile(driver).use { zf ->
val entries = zf.entries() val entries = zf.entries()