Bug Check: seek handler type check to fix crash

Somebody somehow sent this an NSMenuItem? I don't have any UI handlers
calling this IBAction from menus, so someone is messing around with the
code and not removing my crash reporter.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2025-06-12 19:51:45 -07:00
parent 23334dd452
commit 10bfb204b5

View file

@ -379,6 +379,11 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) {
}
- (IBAction)seek:(id)sender {
if(![sender respondsToSelector:@selector(doubleValue)]) {
ALog(@"Someone sent [PlaybackController seek:] a non-seekbar object: %@", sender);
return;
}
double time = [sender doubleValue];
[audioPlayer performSelectorOnMainThread:@selector(seekToTimeBG:) withObjects:@(time), nil];