SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

IDictionary value null check

overing opened this issue · 1 comments

commented

this.InvalidateCache((key, type) => !this.ContentManagersByAssetKey[key].Any(), dispose: true);

[Simple Crop Label] config file value "mouse_hover" is False
[SMAPI] Type 'help' for help, or 'help ' for a command's usage
[SMAPI] An error occured in the base update loop: System.Collections.Generic.KeyNotFoundException: 指定的索引鍵不在字典中。
於 System.Collections.Generic.Dictionary2.get_Item(TKey key) 於 StardewModdingAPI.Framework.SContentManager.<>c__DisplayClass33_0.<DisposeFor>b__1(String key, Type type) 於 C:\source\_Stardew\SMAPI\src\SMAPI\Framework\SContentManager.cs: 行 376 於 StardewModdingAPI.Framework.SContentManager.<>c__DisplayClass32_1.<InvalidateCache>b__1(String key, Type type) 於 C:\source\_Stardew\SMAPI\src\SMAPI\Framework\SContentManager.cs: 行 331 於 StardewModdingAPI.Framework.Content.ContentCache.Remove(Func3 predicate, Boolean dispose) 於 C:\source_Stardew\SMAPI\src\SMAPI\Framework\Content\ContentCache.cs: 行 141
於 StardewModdingAPI.Framework.SContentManager.<>c__DisplayClass32_0.b__0() 於 C:\source_Stardew\SMAPI\src\SMAPI\Framework\SContentManager.cs: 行 328
於 StardewModdingAPI.Framework.SContentManager.WithWriteLock[T](Func1 action) 於 C:\source\_Stardew\SMAPI\src\SMAPI\Framework\SContentManager.cs: 行 796 於 StardewModdingAPI.Framework.SContentManager.InvalidateCache(Func3 predicate, Boolean dispose) 於 C:\source_Stardew\SMAPI\src\SMAPI\Framework\SContentManager.cs: 行 323
於 StardewModdingAPI.Framework.SContentManager.<>c__DisplayClass33_0.b__0() 於 C:\source_Stardew\SMAPI\src\SMAPI\Framework\SContentManager.cs: 行 376
於 StardewModdingAPI.Framework.SContentManager.WithWriteLock(Action action) 於 C:\source_Stardew\SMAPI\src\SMAPI\Framework\SContentManager.cs: 行 780
於 StardewModdingAPI.Framework.SContentManager.DisposeFor(ContentManagerShim shim) 於 C:\source_Stardew\SMAPI\src\SMAPI\Framework\SContentManager.cs: 行 372
於 StardewModdingAPI.Framework.ContentManagerShim.Dispose(Boolean disposing) 於 C:\source_Stardew\SMAPI\src\SMAPI\Framework\ContentManagerShim.cs: 行 47
於 StardewValley.Game1.CleanupReturningToTitle()
於 StardewValley.Game1.Update(GameTime gameTime)
於 StardewModdingAPI.Framework.SGame.Update(GameTime gameTime) 於 C:\source_Stardew\SMAPI\src\SMAPI\Framework\SGame.cs: 行 545

commented

The content managers have been significantly revamped in SMAPI 2.6. Let me know if this still happens when that's released.