Skip to content

Commit

Permalink
fix: avoid loading for JiJ non-forge mods
Browse files Browse the repository at this point in the history
  • Loading branch information
SettingDust committed Apr 20, 2024
1 parent 23bcff8 commit db23fd0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ protected Optional<InputStream> loadResourceFromModFile(final IModFile modFile,
);
return Optional.empty();
} catch (final Exception e) {
logger.error("Failed to load resource {} from mod {}, cause {}", path, modFile.getFileName(), e);
if (modFile != null)
logger.error("Failed to load resource {} from mod {}, cause {}", path, modFile.getFileName(), e);
else
logger.warn("Can't read mod file from {}", path);
return Optional.empty();
}
}
Expand All @@ -150,6 +153,7 @@ protected Optional<IModFile> loadModFileFrom(final IModFile file, final Path pat
}

protected String identifyMod(final IModFile modFile) {
if (modFile == null) return null;
if (modFile.getModFileInfo() == null || modFile.getModInfos().isEmpty()) {
return modFile.getFileName();
}
Expand Down

0 comments on commit db23fd0

Please sign in to comment.