From 95522489c279aac8bdcb0e45bf7c2e006a073063 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 18 Apr 2024 17:53:19 +0800 Subject: [PATCH] macosx: Fix information window not being shown at all when currently playing input item is nil, but without crashing Signed-off-by: Claudio Cambra --- modules/gui/macosx/menus/VLCMainMenu.m | 6 +----- modules/gui/macosx/panels/VLCInformationWindowController.m | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/gui/macosx/menus/VLCMainMenu.m b/modules/gui/macosx/menus/VLCMainMenu.m index 08d96835c8..cbbcdb72b6 100644 --- a/modules/gui/macosx/menus/VLCMainMenu.m +++ b/modules/gui/macosx/menus/VLCMainMenu.m @@ -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]; } diff --git a/modules/gui/macosx/panels/VLCInformationWindowController.m b/modules/gui/macosx/panels/VLCInformationWindowController.m index e60b9eb669..2907906dc2 100644 --- a/modules/gui/macosx/panels/VLCInformationWindowController.m +++ b/modules/gui/macosx/panels/VLCInformationWindowController.m @@ -264,7 +264,7 @@ _##field##TextField.delegate = self - (void)setRepresentedInputItem:(VLCInputItem *)representedInputItem { - _representedInputItems = @[representedInputItem]; + _representedInputItems = representedInputItem == nil ? @[] : @[representedInputItem]; _artwork = [VLCLibraryImageCache thumbnailForInputItem:representedInputItem]; [self updateRepresentation]; }