From d539dc12a1e9fbdfce65188f43ccacb0295a9538 Mon Sep 17 00:00:00 2001 From: cpw Date: Sat, 26 Jan 2019 17:07:17 -0500 Subject: [PATCH] Fix modsorter to not crash on soft dependencies that don't exist. Signed-off-by: cpw --- .../java/net/minecraftforge/fml/loading/ModSorter.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/ModSorter.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/ModSorter.java index 69ed15e08..e33b28850 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/ModSorter.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/ModSorter.java @@ -123,8 +123,11 @@ public class ModSorter @SuppressWarnings("UnstableApiUsage") private void addDependency(MutableGraph topoGraph, IModInfo.ModVersion dep) { - ModFileInfo self = (ModFileInfo)dep.getOwner().getOwningFile(); - ModFileInfo target = modIdNameLookup.get(dep.getModId()).getOwningFile(); + final ModFileInfo self = (ModFileInfo)dep.getOwner().getOwningFile(); + final ModInfo targetModInfo = modIdNameLookup.get(dep.getModId()); + // soft dep that doesn't exist. Just return. No edge required. + if (targetModInfo == null) return; + final ModFileInfo target = targetModInfo.getOwningFile(); if (self == target) return; // in case a jar has two mods that have dependencies between switch (dep.getOrdering()) {