Skip to content

Commit

Permalink
Fix: Correctly throw error when failed to reload prefab
Browse files Browse the repository at this point in the history
  • Loading branch information
0ffz committed Jan 26, 2024
1 parent 0aad835 commit 911394a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class PrefabLoader {
formats[ext]?.decodeFromFile(serializer, path)
?: throw IllegalArgumentException("Unknown file format $ext")
}

// Stop here if we need to make a new entity
// For existing prefabs, add all tags except decoded on fail to keep them tracked
if (writeTo == null && decoded.isFailure) decoded.getOrThrow()
Expand All @@ -71,6 +70,7 @@ class PrefabLoader {
entity.set(Prefab(path))
decoded.getOrNull()?.let { entity.setAll(it) }
entity.set(key)
decoded.getOrThrow()
return entity
}

Expand Down

0 comments on commit 911394a

Please sign in to comment.