From cd14377dcd418a807ec52652fa7c0f25520964eb Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sun, 19 Jun 2022 00:20:40 -0700 Subject: [PATCH] [Now Playing Spam] Don't crash if nothing playing Don't crash on now playing spam hotkey if no track is currently playing. Signed-off-by: Christopher Snowhill --- Application/PlaybackController.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Application/PlaybackController.m b/Application/PlaybackController.m index 8a39c2544..ea3f5fbaf 100644 --- a/Application/PlaybackController.m +++ b/Application/PlaybackController.m @@ -285,11 +285,14 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) { } - (IBAction)spam:(id)sender { - NSPasteboard *pboard = [NSPasteboard generalPasteboard]; + PlaylistEntry *pe = [playlistController currentEntry]; + if(pe) { + NSPasteboard *pboard = [NSPasteboard generalPasteboard]; - [pboard clearContents]; + [pboard clearContents]; - [pboard writeObjects:@[[[playlistController currentEntry] spam]]]; + [pboard writeObjects:@[[pe spam]]]; + } } - (IBAction)eventSeekForward:(id)sender {