jmluis / tinvedit

inventory editor for terraria game
GNU General Public License v3.0
39 stars 14 forks source link

Invalid cast when btnMaxAll event fired #5

Closed jmluis closed 7 years ago

jmluis commented 7 years ago

View details in Rollbar: https://rollbar.com/chbshoot/Terraria-Inventory-Editor/items/11/

Traceback (most recent call last):
  File "TerrariaInvEdit.UI.Forms.MainForm", line 82, in TerrariaInvEdit.UI.Forms.MainForm.btnMaxAll_Click_1(System.Object sender, System.EventArgs e)
  File "System.Windows.Forms.ToolStripItem", line 21, in System.Windows.Forms.ToolStripItem.RaiseEvent(System.Object key, System.EventArgs e)
  File "System.Windows.Forms.ToolStripMenuItem", line 30, in System.Windows.Forms.ToolStripMenuItem.OnClick(System.EventArgs e)
  File "System.Windows.Forms.ToolStripItem", line 66, in System.Windows.Forms.ToolStripItem.HandleClick(System.EventArgs e)
  File "System.Windows.Forms.ToolStripItem", line 203, in System.Windows.Forms.ToolStripItem.HandleMouseUp(System.Windows.Forms.MouseEventArgs e)
  File "System.Windows.Forms.ToolStrip", line 111, in System.Windows.Forms.ToolStrip.OnMouseUp(System.Windows.Forms.MouseEventArgs mea)
  File "System.Windows.Forms.ToolStripDropDown", line 7, in System.Windows.Forms.ToolStripDropDown.OnMouseUp(System.Windows.Forms.MouseEventArgs mea)
  File "System.Windows.Forms.Control", line 388, in System.Windows.Forms.Control.WmMouseUp(System.Windows.Forms.Message& m, System.Windows.Forms.MouseButtons button, System.Int32 clicks)
  File "System.Windows.Forms.Control", line 1225, in System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message& m)
  File "System.Windows.Forms.ToolStrip", line 227, in System.Windows.Forms.ToolStrip.WndProc(System.Windows.Forms.Message& m)
  File "System.Windows.Forms.ToolStripDropDown", line 120, in System.Windows.Forms.ToolStripDropDown.WndProc(System.Windows.Forms.Message& m)
  File "System.Windows.Forms.NativeWindow", line 37, in System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, System.Int32 msg, System.IntPtr wparam, System.IntPtr lparam)
System.InvalidCastException: Specified cast is not valid.
jmluis commented 7 years ago

Caused due to treeNode(piggy bank 3).nodes.Tag = "item" instead of the item object. Fixed in chbshoot/tinvedit@fae192d2fb2f0ffcfdf0ec6d25a956dfc7347a26