diff --git a/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java b/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java index abcc36bf..862396af 100644 --- a/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java +++ b/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java @@ -32,6 +32,8 @@ public class ModuleManager public void load(ProxyServer proxy, File moduleDirectory) throws Exception { + moduleDirectory.mkdir(); + ModuleVersion bungeeVersion = ModuleVersion.parse( proxy.getVersion() ); if ( bungeeVersion == null ) { @@ -39,8 +41,6 @@ public class ModuleManager return; } - moduleDirectory.mkdir(); - List modules = new ArrayList<>(); File configFile = new File( "modules.yml" ); // Start Yaml @@ -66,9 +66,10 @@ public class ModuleManager // End yaml List defaults = new ArrayList<>(); - if ( config.containsKey( "modules" ) ) + Object readModules = config.get( "modules" ); + if ( readModules != null ) { - defaults.addAll( (Collection) config.get( "modules" ) ); + defaults.addAll( (Collection) readModules ); } int version = ( config.containsKey( "version" ) ) ? (int) config.get( "version" ) : 0; switch ( version )