Fix modsorter to not crash on soft dependencies that don't exist.
Signed-off-by: cpw <cpw+github@weeksfamily.ca>
This commit is contained in:
parent
c578cae676
commit
d539dc12a1
1 changed files with 5 additions and 2 deletions
|
@ -123,8 +123,11 @@ public class ModSorter
|
|||
@SuppressWarnings("UnstableApiUsage")
|
||||
private void addDependency(MutableGraph<ModFileInfo> 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()) {
|
||||
|
|
Loading…
Reference in a new issue