LoadedCamel / MidsReborn

Mids' Reborn : Hero Designer
GNU General Public License v3.0
24 stars 8 forks source link

Null Reference Exception when loading file with unallocated powers #91

Closed SevereIrritant closed 3 years ago

SevereIrritant commented 3 years ago

Null Reference Exception when loading any file where there are unallocated powers.

I tested every archetype. All display the error if any number of powers are unallocated. All except peacebringer load normally if all powers are allocated.

Peacebringers display the problem even if all powers are allocated. I tested several combinations, it occured with every one. I didn't test every possible combination of powers for obvious reasons. It doesn't seem to be related to the Glinting Eye issue I reported. The error occurs whether it is selected or not.

The error occurs on launch if "Load last build on startup" is enabled.

To reproduce: Create a new build. Allocate any number of powers other than a full set. At least one must be unallocated. Save the file. Load the file - the error is displayed. Allocate all remaining powers. Save the file. Load the file - no error is displayed (except peacebringers).

Tested on v3.0.5.9 database 21.0709. v3.0.5.7 database 21.707 does not display this error.

Error: System.NullReferenceException: Object reference not set to an instance of an object. at Mids_Reborn.Forms.frmMain.<>c.b__276_0(PowerEntry pe) at System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func2 predicate) at Mids_Reborn.Forms.frmMain.DoOpen(String fName) at Mids_Reborn.Forms.frmMain.tsFileOpen_Click(Object sender, EventArgs e) at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

zethriller commented 3 years ago

This issue has been fixed in developement build and will be pushed to live soon.

Crytilis commented 3 years ago

Fixed and pushed