[FIX] Когда по ошибке в папке модулей оказывается библиотека, не засыпаем консоль NPE.

This commit is contained in:
Zaxar163 2019-11-29 18:31:36 +01:00
parent 9456c45a3d
commit fe0b4ccf04
No known key found for this signature in database
GPG key ID: 1FE4F2E1F053831B

View file

@ -144,7 +144,7 @@ public LauncherModule loadModule(LauncherModule module) {
@Override @Override
public LauncherModule loadModule(Path file) throws IOException { public LauncherModule loadModule(Path file) throws IOException {
try (JarFile f = new JarFile(file.toFile())) { try (JarFile f = new JarFile(file.toFile())) {
String moduleClass = f.getManifest().getMainAttributes().getValue("Module-Main-Class"); String moduleClass = f.getManifest() != null ? f.getManifest().getMainAttributes().getValue("Module-Main-Class") : null;
if (moduleClass == null) { if (moduleClass == null) {
LogHelper.error("In module %s Module-Main-Class not found", file.toString()); LogHelper.error("In module %s Module-Main-Class not found", file.toString());
return null; return null;