Skip to content

Commit 5bf8739

Browse files
authored
Prevent an invalid world from breaking the world chooser dialog (#1897)
1 parent 13b9cdd commit 5bf8739

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

chunky/src/java/se/llbit/chunky/ui/WorldChooserController.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import se.llbit.chunky.PersistentSettings;
3535
import se.llbit.chunky.map.WorldMapLoader;
3636
import se.llbit.chunky.resources.MinecraftFinder;
37+
import se.llbit.chunky.world.EmptyWorld;
3738
import se.llbit.chunky.world.World;
3839
import se.llbit.log.Log;
3940

@@ -159,8 +160,10 @@ protected List<World> call() {
159160
if (worldDirs != null) {
160161
for (File dir : worldDirs) {
161162
if (World.isWorldDir(dir)) {
162-
worlds.add(World.loadWorld(dir, World.OVERWORLD_DIMENSION,
163-
World.LoggedWarnings.SILENT));
163+
World world = World.loadWorld(dir, World.OVERWORLD_DIMENSION, World.LoggedWarnings.SILENT);
164+
if (world != EmptyWorld.INSTANCE) {
165+
worlds.add(world);
166+
}
164167
}
165168
}
166169
}

0 commit comments

Comments
 (0)