haven1433 / HexManiacAdvance

A tool for editing tables, text, scripts, images, and other data in Pokemon GBA games
MIT License
228 stars 50 forks source link

Crash when adding an Npc #213

Closed Coneruu closed 4 months ago

Coneruu commented 5 months ago

I just added an NPC and a crash occurs

Notes from crash.log:

Version Number: 0.5.6
Release Version
01/05/2024 19:27:30
General Information:
Current tab count: 2
Current selected tab: 1
---
Tab is ViewPort for Pokemon - FireRed Version (USA, Europe) (Rev 1).gba
Game Code: BPRE1
Data Length: 0x1000000
Pokemon Count: 412
---
Tab is map for (3-0)
Size: 24x37
Events: 5-2-1-1
---
Exception Information:
System.NullReferenceException
Object reference not set to an instance of an object.
   at HavenSoft.HexManiac.Core.ViewModels.Map.BlockMapViewModel.get_EventGroup() in D:\root\GitHub\HexManiac\src\HexManiac.Core\ViewModels\Map\BlockMapViewModel.cs:line 2387
   at HavenSoft.HexManiac.Core.ViewModels.Map.BlockMapViewModel.UpdateClone(BlockMapViewModel neighbor, ObjectEventViewModel parentEvent, Boolean deleted) in D:\root\GitHub\HexManiac\src\HexManiac.Core\ViewModels\Map\BlockMapViewModel.cs:line 799
   at HavenSoft.HexManiac.Core.ViewModels.Map.MapEditorViewModel.EventUp(Double x, Double y) in D:\root\GitHub\HexManiac\src\HexManiac.Core\ViewModels\Map\MapEditorViewModel.cs:line 930
   at HavenSoft.HexManiac.Core.ViewModels.Map.MapEditorViewModel.PrimaryUp(Double x, Double y) in D:\root\GitHub\HexManiac\src\HexManiac.Core\ViewModels\Map\MapEditorViewModel.cs:line 768
   at HavenSoft.HexManiac.WPF.Controls.MapTab.ButtonUp(Object sender, MouseButtonEventArgs e) in D:\root\GitHub\HexManiac\src\HexManiac.WPF\Controls\MapTab.xaml.cs:line 216
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

-------------------------------------------
haven1433 commented 4 months ago

Based on the callstack, I believe this is now fixed in the latest source. So the fix should be available in 0.5.7.