SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Crash if content packs use different capitalisation for required mod ID

Pathoschild opened this issue ยท 1 comments

commented

If two content packs have the same ContentPackFor.UniqueID but different capitalisation (like Pathoschild.ContentPatcher and pathoschild.contentpatcher), SMAPI crashes with this error:

An error occured in the overridden update loop: System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at StardewModdingAPI.Program.LoadMods(IModMetadata[] mods, JsonHelper jsonHelper, ContentCore contentCore, ModDatabase modDatabase) in C:\source\_Stardew\SMAPI\src\SMAPI\Program.cs:line 737
at StardewModdingAPI.Program.InitialiseAfterGameStart() in C:\source\_Stardew\SMAPI\src\SMAPI\Program.cs:line 395
at StardewModdingAPI.Framework.SGame.Update(GameTime gameTime) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\SGame.cs:line 321
commented

Fixed in develop for the upcoming SMAPI 2.5.5.