diff options
| author | Linnea Gräf <nea@nea.moe> | 2025-11-04 20:32:02 +0100 |
|---|---|---|
| committer | Linnea Gräf <nea@nea.moe> | 2025-11-04 20:32:02 +0100 |
| commit | d403eb70e95d66c43e8b5266b3e0e8d495d6fd93 (patch) | |
| tree | f6833ab2855b6975d48a8e8653c1c509b4cd72e4 /src/main/kotlin | |
| parent | ffd7e1a90941065bdc835deafd51f42688078ab2 (diff) | |
| download | Firmament-d403eb70e95d66c43e8b5266b3e0e8d495d6fd93.tar.gz Firmament-d403eb70e95d66c43e8b5266b3e0e8d495d6fd93.tar.bz2 Firmament-d403eb70e95d66c43e8b5266b3e0e8d495d6fd93.zip | |
fix: crash involving non uuid folders in profiles config
Diffstat (limited to 'src/main/kotlin')
| -rw-r--r-- | src/main/kotlin/gui/config/storage/FirmamentConfigLoader.kt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/kotlin/gui/config/storage/FirmamentConfigLoader.kt b/src/main/kotlin/gui/config/storage/FirmamentConfigLoader.kt index ce313cb..0292721 100644 --- a/src/main/kotlin/gui/config/storage/FirmamentConfigLoader.kt +++ b/src/main/kotlin/gui/config/storage/FirmamentConfigLoader.kt @@ -57,9 +57,11 @@ object FirmamentConfigLoader { profilePath.takeIf { it.exists() } ?.listDirectoryEntries() ?.filter { it.isDirectory() } - ?.associate { - UUID.fromString(it.name) to FirstLevelSplitJsonFolder(loadContext, it).load() + ?.mapNotNull { + val uuid= runCatching { UUID.fromString(it.name) }.getOrNull() ?: return@mapNotNull null + uuid to FirstLevelSplitJsonFolder(loadContext, it).load() } + ?.toMap() if (profileData.isNullOrEmpty()) profileData = mapOf(NULL_UUID to JsonObject(mapOf())) profileData.forEach { (key, value) -> |
