[Playlist] Guard Open in Finder against empty set

Guard Open in Finder against being called on a playlist with no
selection, which may happen if the action is triggered on an empty
playlist, which would cause an array out of bounds access error.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
swiftingly
Christopher Snowhill 2022-06-13 16:28:29 -07:00
parent 686cf95795
commit 9d558a89ab
1 changed files with 2 additions and 0 deletions

View File

@ -1282,6 +1282,8 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
}
- (IBAction)showEntryInFinder:(id)sender {
if([[self selectedObjects] count] == 0) return;
NSWorkspace *ws = [NSWorkspace sharedWorkspace];
NSURL *url = [[self selectedObjects][0] URL];