rds1983 / Myra

UI Library for MonoGame, FNA and Stride
MIT License
704 stars 93 forks source link

MenuItem -> SubMenuItem Crash #354

Closed luisestrada115 closed 2 years ago

luisestrada115 commented 2 years ago

MyraTest2.zip

Steps to reproduce:

  1. Click "Create Item"
  2. Then click "Weapon"
  3. Click "Create Item" again
  4. Hover over "Armor"
System.NullReferenceException: 'Object reference not set to an instance of an object.'
   at Myra.Graphics2D.UI.Menu.ShowSubMenu(MenuItem menuItem)
   at Myra.Graphics2D.UI.Grid.set_SelectedRowIndex(Nullable`1 value)
   at Myra.Graphics2D.UI.Menu.OnHoverIndexChanged(Object sender, EventArgs eventArgs)
   at Myra.Graphics2D.UI.Grid.set_HoverRowIndex(Nullable`1 value)
   at Myra.Graphics2D.UI.Grid.UpdateHoverPosition(Nullable`1 position)
   at Myra.Graphics2D.UI.Grid.OnMouseEntered()
   at Myra.Utility.InputHelpers.ProcessMouseMovement(List`1 widgets)
   at Myra.Utility.InputHelpers.ProcessMouseMovement(List`1 widgets)
   at Myra.Graphics2D.UI.Desktop.set_MousePosition(Point value)
   at Myra.Graphics2D.UI.Desktop.UpdateMouseInput()
   at Myra.Graphics2D.UI.Desktop.UpdateInput()
   at Myra.Graphics2D.UI.Desktop.Render()
   at MyraTest.MyraTest.Draw(GameTime gameTime) in C:\dev\MyraTest2\MyraTest\MyraTest.cs:line 91
rds1983 commented 2 years ago

Should be fixed in 1.4.1