diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/managers/SimpleModuleManager.java b/LauncherAPI/src/main/java/pro/gravit/launcher/managers/SimpleModuleManager.java index 8a929b78..f6ecda38 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/managers/SimpleModuleManager.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/managers/SimpleModuleManager.java @@ -28,7 +28,13 @@ private ModulesVisitor() { public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (file.toFile().getName().endsWith(".jar")) try (JarFile f = new JarFile(file.toFile())) { - loadModule(file.toUri().toURL(), f.getManifest().getMainAttributes().getValue("Main-Class")); + String mainclass = f.getManifest().getMainAttributes().getValue("Main-Class"); + if(mainclass == null) + { + LogHelper.error("In module %s Main-Class not found", file.toString()); + return super.visitFile(file, attrs); + } + loadModule(file.toUri().toURL(), mainclass); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { LogHelper.error(e); }