cdaragorn / Ui-Info-Suite

Mod for Stardew Valley.
87 stars 360 forks source link

fix NPE while trying to render a tooltip when not hovering an item #36

Closed midorlo closed 4 years ago

midorlo commented 4 years ago

typeof(ShopMenu).GetField("hoveredItem").GetValue() will be null if there is no item hovered. Therefore null.GetValue(menu) was invoked.

Opening any vendor's Window will provoke said NPE

LunaLycan287 commented 4 years ago

it would be a good idea to seperate the two commits into seperate PRs since they work on different topics.

Also thanks for the NPE fix I needed that too.

midorlo commented 4 years ago

Yeah that was by accident (Im not used to VS -.-). I guess you should reject the PR thenm and just commit the NPE yourself. It's just a single line after all :-)

midorlo commented 4 years ago

The PR should be fine now

cdaragorn commented 4 years ago

Sorry, this change is no longer relevant as of SDV 1.4. They made the hovered item a property in the menu itself so we no longer need reflection to get it and the null issue is handled.