MattEqualsCoder / MSUScripter

Application for creating MSUs and related files
MIT License
5 stars 2 forks source link

Copying a previously copied/moved song crashes MSU Scripter #107

Closed Vivelin closed 5 months ago

Vivelin commented 5 months ago

Steps to reproduce:

  1. Add a song
  2. Copy the song to another track
  3. Open the track you copied the song to
  4. Copy the song to another track
  5. MSU Scripter crashes

If you reload MSU Scripter afterwards, it works fine.

From the logs:

2024-05-01 15:25:45.991 +02:00 [ERR] [CRASH] Uncaught NullReferenceException: 
System.NullReferenceException: Object reference not set to an instance of an object.
   at MSUScripter.Controls.MsuSongInfoPanel.CopySongMenuItem_OnClick(Object sender, RoutedEventArgs e) in D:\a\MSUScripter\MSUScripter\MSUScripter\Controls\MsuSongInfoPanel.axaml.cs:line 150
   at Avalonia.Interactivity.Interactive.<AddHandler>g__InvokeAdapter|4_0[TEventArgs](Delegate baseHandler, Object sender, RoutedEventArgs args)
   at Avalonia.Interactivity.Interactive.<>c__4`1.<AddHandler>b__4_1(Delegate baseHandler, Object sender, RoutedEventArgs args)
   at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e)
   at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e)
   at Avalonia.Controls.MenuItem.Avalonia.Controls.IMenuItem.RaiseClick()
   at Avalonia.Controls.Platform.DefaultMenuInteractionHandler.Click(IMenuItem item)
   at Avalonia.Controls.Platform.DefaultMenuInteractionHandler.PointerReleased(Object sender, PointerReleasedEventArgs e)
   at Avalonia.Interactivity.Interactive.<AddHandler>g__InvokeAdapter|4_0[TEventArgs](Delegate baseHandler, Object sender, RoutedEventArgs args)
   at Avalonia.Interactivity.Interactive.<>c__4`1.<AddHandler>b__4_1(Delegate baseHandler, Object sender, RoutedEventArgs args)
   at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e)
   at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e)
   at Avalonia.Input.MouseDevice.MouseUp(IMouseDevice device, UInt64 timestamp, IInputRoot root, Point p, PointerPointProperties props, KeyModifiers inputModifiers, IInputElement hitTest)
   at Avalonia.Input.MouseDevice.ProcessRawEvent(RawPointerEventArgs e)
   at Avalonia.Controls.TopLevel.HandleInput(RawInputEventArgs e)
   at Avalonia.Win32.WindowImpl.AppWndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
   at Avalonia.Win32.PopupImpl.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
   at Avalonia.Win32.Win32DispatcherImpl.RunLoop(CancellationToken cancellationToken)
   at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl impl)
   at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, Action`1 lifetimeBuilder)
   at MSUScripter.Program.Main(String[] args) in D:\a\MSUScripter\MSUScripter\MSUScripter\Program.cs:line 44