macosx: Fix information window not being shown at all when currently playing input item is nil, but without crashing

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
Claudio Cambra 2024-04-18 17:53:19 +08:00 committed by Jean-Baptiste Kempf
parent ed30c1263e
commit 95522489c2
2 changed files with 2 additions and 6 deletions

View File

@ -1536,11 +1536,7 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
_infoWindowController.mainMenuInstance = YES;
}
VLCInputItem * const currentInputItem = _playlistController.currentlyPlayingInputItem;
if (currentInputItem == nil) {
return;
}
_infoWindowController.representedInputItem = currentInputItem;
_infoWindowController.representedInputItem = _playlistController.currentlyPlayingInputItem;
[_infoWindowController toggleWindow:sender];
}

View File

@ -264,7 +264,7 @@ _##field##TextField.delegate = self
- (void)setRepresentedInputItem:(VLCInputItem *)representedInputItem
{
_representedInputItems = @[representedInputItem];
_representedInputItems = representedInputItem == nil ? @[] : @[representedInputItem];
_artwork = [VLCLibraryImageCache thumbnailForInputItem:representedInputItem];
[self updateRepresentation];
}