diff --git a/MusicX/Controls/QueueTrackControl.xaml.cs b/MusicX/Controls/QueueTrackControl.xaml.cs index 99608c47..c787783b 100644 --- a/MusicX/Controls/QueueTrackControl.xaml.cs +++ b/MusicX/Controls/QueueTrackControl.xaml.cs @@ -46,7 +46,7 @@ public bool IsCurrentlyPlaying } private int IndexInItemsControl => - ItemContainerGeneratorIndexHook.GetItemContainerIndex(((FrameworkElement)TemplatedParent).TemplatedParent); + ItemContainerGeneratorIndexHook.GetItemContainerIndex(((FrameworkElement)TemplatedParent).TemplatedParent ?? TemplatedParent); public QueueTrackControl() {