Skip to content

Commit

Permalink
Fix crash with entrypoint caching off
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Nov 12, 2024
1 parent 51f491e commit 0320024
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private EntrypointCaching() {

@SuppressWarnings("unused")
public List<ModContainer> discoverCachedEntrypoints(ModCandidate candidate, ASMDataTable table, JarFile file, MetadataCollection mc) {
if (!PatcherConfig.cacheEntrypoints) return null;
if (!PatcherConfig.cacheEntrypoints || readMap == null) return null;
File modFile = candidate.getModContainer();

String hash = getHash(modFile);
Expand Down Expand Up @@ -127,7 +127,7 @@ private void iterateThroughClass(boolean entry, ModCandidate candidate, ASMDataT

@SuppressWarnings("unused")
public void putCachedEntrypoints(ModCandidate candidate, ZipEntry ze) {
if (!PatcherConfig.cacheEntrypoints) return;
if (!PatcherConfig.cacheEntrypoints || readMap == null) return;
File modFile = candidate.getModContainer();
String modClass = ze.getName();

Expand All @@ -142,7 +142,7 @@ public void putCachedEntrypoints(ModCandidate candidate, ZipEntry ze) {

@SuppressWarnings("unused")
public void putCachedClassEntries(ModCandidate candidate, ZipEntry ze) {
if (!PatcherConfig.cacheEntrypoints) return;
if (!PatcherConfig.cacheEntrypoints || readMap == null) return;

File modFile = candidate.getModContainer();
String modClass = ze.getName();
Expand All @@ -155,7 +155,7 @@ public void putCachedClassEntries(ModCandidate candidate, ZipEntry ze) {
}

public void onInit() {
if (!PatcherConfig.cacheEntrypoints) return;
if (!PatcherConfig.cacheEntrypoints || readMap == null) return;
readMap = null;

File patcherDir = new File("patcher");
Expand Down

0 comments on commit 0320024

Please sign in to comment.