as per comments, remove where in favor of nullchecking id instead

This commit is contained in:
atravita-mods 2023-03-23 22:24:07 -04:00 committed by Jesse Plamondon-Willard
parent 58ccaf9a1e
commit c12e9d788e
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
1 changed files with 4 additions and 2 deletions

View File

@ -178,10 +178,12 @@ namespace StardewModdingAPI.Framework.ModLoading
string[] lateArray = modIdsToLoadLate.ToArray(); string[] lateArray = modIdsToLoadLate.ToArray();
return mods return mods
.Where(mod => mod.FailReason is not null)
.OrderBy(mod => .OrderBy(mod =>
{ {
string id = mod.Manifest.UniqueID; string? id = mod.Manifest?.UniqueID;
if (id is null)
return 0;
if (modIdsToLoadEarly.TryGetValue(id, out string? actualId)) if (modIdsToLoadEarly.TryGetValue(id, out string? actualId))
return -int.MaxValue + Array.IndexOf(earlyArray, actualId); return -int.MaxValue + Array.IndexOf(earlyArray, actualId);