fix npe with invalid manifest

This commit is contained in:
CherretGit
2026-03-14 20:14:27 +07:00
parent 47c3b24733
commit 1f2df5bdfc

View File

@@ -160,9 +160,8 @@ fun getValidManifests(listsDir: File): Array<StorageData> {
return (listsDir.listFiles()
?.mapNotNull { file ->
if (!file.isFile || file.extension.lowercase() != "json") return@mapNotNull null
parseManifestFromFile(file).getOrNull().takeIf {
File(it!!.file).exists()
parseManifestFromFile(file).getOrNull()?.takeIf {
File(it.file).exists()
}
}
?.toTypedArray()