From 29ad7a39deddc01af978d23f77c009fc4330eeae Mon Sep 17 00:00:00 2001 From: DaemonUmbra Date: Fri, 25 Oct 2019 02:06:27 -0400 Subject: [PATCH] Fixed NPEs caused by uninitialized lists in ModDirTransformerDiscoverer (#6277) --- .../fml/loading/ModDirTransformerDiscoverer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/ModDirTransformerDiscoverer.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/ModDirTransformerDiscoverer.java index 7d192d9f0..ed33232ca 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/ModDirTransformerDiscoverer.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/ModDirTransformerDiscoverer.java @@ -54,12 +54,12 @@ public class ModDirTransformerDiscoverer implements ITransformerDiscoveryService private static void scan(final Path gameDirectory) { final Path modsDir = gameDirectory.resolve(FMLPaths.MODSDIR.relative()); + transformers = new ArrayList<>(); + locators = new ArrayList<>(); if (!Files.exists(modsDir)) { // Skip if the mods dir doesn't exist yet. return; } - transformers = new ArrayList<>(); - locators = new ArrayList<>(); try { Files.createDirectories(modsDir); Files.walk(modsDir, 1).forEach(ModDirTransformerDiscoverer::visitFile);