mirror of
https://github.com/rafaelvcaetano/melonDS-android.git
synced 2025-02-20 05:40:45 +00:00
Ensure Migration21to22 cannot crash while parsing ROM metadata
This commit is contained in:
parent
946158402b
commit
8406524f58
@ -30,9 +30,11 @@ class Migration21to22(
|
||||
val originalRoms = getOriginalRoms()
|
||||
val newRoms = originalRoms.mapNotNull { rom ->
|
||||
val fileName = uriHandler.getUriDocument(rom.uri)?.name ?: return@mapNotNull null
|
||||
val romMetadata = context.contentResolver.openInputStream(rom.uri)?.use {
|
||||
RomProcessor.getRomMetadata(it.buffered())
|
||||
} ?: return@mapNotNull null
|
||||
val romMetadata = runCatching {
|
||||
context.contentResolver.openInputStream(rom.uri)?.use {
|
||||
RomProcessor.getRomMetadata(it.buffered())
|
||||
}
|
||||
}.getOrNull() ?: return@mapNotNull null
|
||||
|
||||
Rom(
|
||||
rom.name,
|
||||
|
Loading…
x
Reference in New Issue
Block a user