From cc4210d95ad8636cb69e7ac2d2ade7dd6a437133 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sat, 6 Sep 2014 18:49:50 -0500 Subject: [PATCH] Verify folder exists after its generated. --- core/WorldSettings.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/WorldSettings.java b/core/WorldSettings.java index c0bfc2c5..67976c25 100644 --- a/core/WorldSettings.java +++ b/core/WorldSettings.java @@ -258,21 +258,21 @@ public class WorldSettings extends Configuration File aeBaseFolder = new File( world.getPath() + File.separatorChar + "AE2" ); if ( !aeBaseFolder.exists() || !aeBaseFolder.isDirectory() ) - if ( !aeBaseFolder.mkdir() ) + if ( !aeBaseFolder.mkdir() || !aeBaseFolder.exists() ) { throw new RuntimeException( "Failed to create " + aeBaseFolder.getAbsolutePath() ); } File compass = new File( aeBaseFolder, "compass" ); if ( !compass.exists() || !compass.isDirectory() ) - if ( !compass.mkdir() ) + if ( !compass.mkdir() || !compass.exists() ) { throw new RuntimeException( "Failed to create " + compass.getAbsolutePath() ); } File spawnData = new File( aeBaseFolder, "spawndata" ); if ( !spawnData.exists() || !spawnData.isDirectory() ) - if ( !spawnData.mkdir() ) + if ( !spawnData.mkdir() || !spawnData.exists() ) { throw new RuntimeException( "Failed to create " + spawnData.getAbsolutePath() ); }