fix: imported avatars trigger NPE on UILoadManage

This commit is contained in:
minjaesong
2023-10-06 15:05:47 +09:00
parent 781f671859
commit 0e21f28609
3 changed files with 3 additions and 2 deletions

View File

@@ -271,7 +271,7 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
it.mapIndexed { index, s -> "${(index+1).toString().padStart(it.size.fastLen())}. $s" }
} ?: listOf("$EMDASH")
loadOrderWorld =
App.savegameWorlds[full.playerButtonSelected!!.worldUUID]!!.files[selectedRevision].getFile(
App.savegameWorlds[full.playerButtonSelected!!.worldUUID]?.files?.get(selectedRevision)?.getFile( // it's null for freshly-imported avatars
VDFileID.LOADORDER
)?.getContent()?.toByteArray()?.toString(Common.CHARSET)?.split('\n')?.let {
it.mapIndexed { index, s -> "${(index+1).toString().padStart(it.size.fastLen())}. $s" }