AutoMidiPlayer icon indicating copy to clipboard operation
AutoMidiPlayer copied to clipboard

Remove button in Queue crashes app

Open Jed556 opened this issue 9 months ago • 1 comments

What happened?

The app crashes when clicking the remove button even if a song is selected, but doesn't crash when clicking the remove button in the menu.

Operating System

Windows 10, Windows 11

Steps to reproduce

  1. Go to Queue view
  2. Click a song
  3. Click remove button
Image

Expected behavior

Should remove the song from queue

Additional context

crash_log.txt

[23:52:54.859] [Bootstrapper.cs:51] [OnDispatcherUnhandledException] === DISPATCHER UNHANDLED EXCEPTION ===
[23:52:54.901] [Bootstrapper.cs:52] [OnDispatcherUnhandledException] EXCEPTION: ArgumentNullException: Value cannot be null. (Parameter 'source')
   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Linq.Enumerable.TryGetNonEnumeratedCount[TSource](IEnumerable`1 source, Int32& count)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
   at AutoMidiPlayer.WPF.ViewModels.QueueViewModel.RemoveTrack(IEnumerable`1 selectedFiles) in C:\Users\Jed556\CodeProjects\GitHub\Games\Auto MIDI Player\AutoMidiPlayer\AutoMidiPlayer.WPF\ViewModels\QueueViewModel.cs:line 244
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
--- End of stack trace from previous location ---
   at Stylet.Xaml.ActionBase.InvokeTargetMethod(Object[] parameters)
   at Stylet.Xaml.CommandAction.Execute(Object parameter)
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   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.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 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)

Jed556 avatar Feb 22 '26 16:02 Jed556

Fixed in de437a8f794152b1b43bd87b620beaffeea2f981

Jed556 avatar Feb 23 '26 05:02 Jed556