rds1983 / Myra

UI Library for MonoGame, FNA and Stride
MIT License
726 stars 94 forks source link

Possible bug: TextButton DoClick() gives error #285

Open TheRuneSnake opened 3 years ago

TheRuneSnake commented 3 years ago

Error log:

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at Myra.Graphics2D.UI.Widget.OnTouchDown() at Myra.Graphics2D.UI.Container.OnTouchDown() at Myra.Graphics2D.UI.ButtonBase1.OnTouchDown() at Myra.Graphics2D.UI.ButtonBase1.DoClick() at MPNext.GeneratedECS.datatype.Component_Global.GenerateDebugUI(VerticalStackPanel panel, Component component) in C:\Users\Laptop Glenn\Documents\MonopolisNext\MPNext\MonoDebugUI\Components\ComponentGlobal.cs:line 58 at MPNext.MonoDebugUI.ElementInspectorWindow.GenerateComponent(UInt64 component_id) in C:\Users\Laptop Glenn\Documents\MonopolisNext\MPNext\MonoDebugUI\ElementInspectorWindow.cs:line 80 at MPNext.MonoDebugUI.ElementInspectorWindow.Update() in C:\Users\Laptop Glenn\Documents\MonopolisNext\MPNext\MonoDebugUI\ElementInspectorWindow.cs:line 63 at MPNext.MonoDebugUI.ElementInspectorWindow..ctor(UInt64 entity_id) in C:\Users\Laptop Glenn\Documents\MonopolisNext\MPNext\MonoDebugUI\ElementInspectorWindow.cs:line 30 at MPNext.MonoDebugUI.ECSTreeWindow.InspectElement_Click(Object sender, EventArgs e) in C:\Users\Laptop Glenn\Documents\MonopolisNext\MPNext\MonoDebugUI\ECSTreeWindow.cs:line 64 at Myra.Utility.InputHelpers.ProcessTouchUp(List1 widgets) at Myra.Utility.InputHelpers.ProcessTouchUp(List1 widgets) at Myra.Utility.InputHelpers.ProcessTouchUp(List1 widgets) at Myra.Utility.InputHelpers.ProcessTouchUp(List1 widgets) at Myra.Utility.InputHelpers.ProcessTouchUp(List1 widgets) at Myra.Utility.InputHelpers.ProcessTouchUp(List1 widgets) at Myra.Utility.InputHelpers.ProcessTouchUp(List`1 widgets) at Myra.Graphics2D.UI.Desktop.HandleButton(Boolean isDown, Boolean wasDown, MouseButtons buttons) at Myra.Graphics2D.UI.Desktop.UpdateMouseInput() at Myra.Graphics2D.UI.Desktop.UpdateInput() at Myra.Graphics2D.UI.Desktop.Render() at MPNext.Game1.Draw(GameTime gameTime) in C:\Users\Laptop Glenn\Documents\MonopolisNext\MPNext\Game1.cs:line 91 at Microsoft.Xna.Framework.Game.DoDraw(GameTime gameTime) at Microsoft.Xna.Framework.Game.Tick() at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop() at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior) at MPNext.Program.Main() in C:\Users\Laptop Glenn\Documents\MonopolisNext\MPNext\Program.cs:line 11

rds1983 commented 3 years ago

Need complete sample. As I can't reproduce by just calling DoClick.