Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes an NPE and InvalidOperationException. #766

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

valkyrieBae
Copy link

No description provided.

I'm getting this exception a lot in my game, and it's player.

[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ValheimPlus.UI.HotkeyBar_UpdateIcons_Patch.DisplayAmmoCountsUnderBowHotbarIcon (HotkeyBar __instance, Player player) (at C:/Users/twili/RiderProjects/ValheimPlus/ValheimPlus/UI/HotkeyBar.cs:40)
ValheimPlus.UI.HotkeyBar_UpdateIcons_Patch.Postfix (HotkeyBar& __instance, Player& player) (at C:/Users/twili/RiderProjects/ValheimPlus/ValheimPlus/UI/HotkeyBar.cs:21)
(wrapper dynamic-method) HotkeyBar.DMD<HotkeyBar::UpdateIcons>(HotkeyBar,Player)
HotkeyBar.Update () (at <35c0f7aa1999477788815a7bf78200d7>:0)
Can't modify a collection while you iterate through it without getting an exception. Usually works fine for the player, but it does throw an exception and is bad practice. Could feasibly cause the player an issue if two items were somehow destroyed at once. Stacktrace:

[Error  : Unity Log] InvalidOperationException: Collection was modified; enumeration operation may not execute.
Stack trace:
System.Collections.Generic.Dictionary`2+Enumerator[TKey,TValue].MoveNext () (at <695d1cc93cca45069c528c15c9fdd749>:0)
ValheimPlus.GameClasses.displayCartsAndBoatsOnMap+Minimap_UpdateMap_Patch.Postfix (Minimap& __instance, Player player, System.Single dt, System.Boolean takeInput) (at C:/Users/twili/RiderProjects/ValheimPlus/ValheimPlus/GameClasses/Minimap.cs:419)
(wrapper dynamic-method) Minimap.DMD<Minimap::UpdateMap>(Minimap,Player,single,bool)
Minimap.Update () (at <35c0f7aa1999477788815a7bf78200d7>:0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants