summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModLoading/ModResolver.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/ModLoading/ModResolver.cs')
-rw-r--r--src/SMAPI/Framework/ModLoading/ModResolver.cs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/SMAPI/Framework/ModLoading/ModResolver.cs b/src/SMAPI/Framework/ModLoading/ModResolver.cs
index cb62e16f..607bb70d 100644
--- a/src/SMAPI/Framework/ModLoading/ModResolver.cs
+++ b/src/SMAPI/Framework/ModLoading/ModResolver.cs
@@ -180,13 +180,16 @@ namespace StardewModdingAPI.Framework.ModLoading
return mods
.OrderBy(mod =>
{
- string id = mod.Manifest.UniqueID;
+ string? id = mod.Manifest?.UniqueID;
- if (modIdsToLoadEarly.TryGetValue(id, out string? actualId))
- return -int.MaxValue + Array.IndexOf(earlyArray, actualId);
+ if (id is not null)
+ {
+ if (modIdsToLoadEarly.TryGetValue(id, out string? actualId))
+ return -int.MaxValue + Array.IndexOf(earlyArray, actualId);
- if (modIdsToLoadLate.TryGetValue(id, out actualId))
- return int.MaxValue - Array.IndexOf(lateArray, actualId);
+ if (modIdsToLoadLate.TryGetValue(id, out actualId))
+ return int.MaxValue - Array.IndexOf(lateArray, actualId);
+ }
return 0;
})