MHeasell / Mappy

A modern map editor for Total Annihilation
MIT License
14 stars 2 forks source link

"System.ArgumentException: Parameter is not valid." when deserializing minimap #5

Open MHeasell opened 6 years ago

MHeasell commented 6 years ago

Error in Mappy

System.ArgumentException in :0 Parameter is not valid.

View on Bugsnag

Stacktrace

:0 - System.Drawing.Bitmap..ctor(int width, int height, PixelFormat format)

View full stacktrace

Created by Michael Heasell via Bugsnag

MHeasell commented 6 years ago

Full stacktrace:

System.ArgumentException: Parameter is not valid.
   at System.Drawing.Bitmap..ctor(int width, int height, PixelFormat format)
   at TAUtil.Gdi.Bitmap.BitmapDeserializer.Deserialize(Stream bytes, int width, int height) in C:\projects\mappy\TAUtil\TAUtil.Gdi\Bitmap\BitmapDeserializer.cs:line 50
   at Mappy.IO.MapModelFactory.ToBitmap(MinimapInfo minimap) in C:\projects\mappy\Mappy\IO\MapModelFactory.cs:line 109
   at Mappy.IO.MapModelFactory.ReadTnt(ITntSource tnt, MapModel model) in C:\projects\mappy\Mappy\IO\MapModelFactory.cs:line 130
   at Mappy.IO.MapModelFactory.FromTntAndOta(ITntSource tnt, TdfNode ota) in C:\projects\mappy\Mappy\IO\MapModelFactory.cs:line 36
   at Mappy.Services.MapLoadingService.CreateFromHpi(string hpipath, string mappath, bool readOnly) in C:\projects\mappy\Mappy\Services\MapLoadingService.cs:line 102
   at Mappy.Services.Dispatcher.OpenFromHapi(string filename) in C:\projects\mappy\Mappy\Services\Dispatcher.cs:line 735
   at Mappy.Services.Dispatcher.OpenMap(string filename) in C:\projects\mappy\Mappy\Services\Dispatcher.cs:line 679
   at Mappy.Services.Dispatcher.Open() in C:\projects\mappy\Mappy\Services\Dispatcher.cs:line 218
   at Mappy.Models.MainFormViewModel.OpenMenuItemClick() in C:\projects\mappy\Mappy\Models\MainFormViewModel.cs:line 185
   at Mappy.UI.Forms.MainForm.OpenMenuItemClick(object sender, EventArgs e) in C:\projects\mappy\Mappy\UI\Forms\MainForm.cs:line 92
   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.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(ref Message m, MouseButtons button, int clicks)
   at System.Windows.Forms.Control.WndProc(ref Message m)
   at System.Windows.Forms.ScrollableControl.WndProc(ref Message m)
   at System.Windows.Forms.ToolStrip.WndProc(ref Message m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(ref Message m)
   at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(ref Message m)
   at System.Windows.Forms.Control+ControlNativeWindow.WndProc(ref Message m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(ref MSG msg)
   at System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, int reason, int pvLoopData)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(int reason, ApplicationContext context)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoop(int reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at Mappy.Program.Main() in C:\projects\mappy\Mappy\Program.cs:line 79
MHeasell commented 6 years ago

At a wild guess I'd suspect that the size of the minimap was 0. Check this.