[vlc-commits] [Git][videolan/vlc][master] 2 commits: macosx: Prevent crash from assigning nil string to controls bar detail label

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Dec 17 15:21:35 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
d4be06be by Claudio Cambra at 2024-12-17T15:01:17+00:00
macosx: Prevent crash from assigning nil string to controls bar detail label

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
91864bc5 by Claudio Cambra at 2024-12-17T15:01:17+00:00
macosx: Safeguard against nil string set on controls bar playingItemDisplayField

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


1 changed file:

- modules/gui/macosx/windows/controlsbar/VLCControlsBarCommon.m


Changes:

=====================================
modules/gui/macosx/windows/controlsbar/VLCControlsBarCommon.m
=====================================
@@ -482,12 +482,12 @@
     VLCMediaLibraryMediaItem * const mediaItem =
         [VLCMediaLibraryMediaItem mediaItemForURL:_playerController.URLOfCurrentMediaItem];
 
-    self.playingItemDisplayField.stringValue = inputItem ? inputItem.name : _NS("No current item");
+    self.playingItemDisplayField.stringValue = inputItem.name ?: _NS("No current item");
     self.detailLabel.hidden =
         mediaItem == nil ||
         [mediaItem.primaryDetailString isEqualToString:@""] ||
         [mediaItem.primaryDetailString isEqualToString:mediaItem.durationString];
-    self.detailLabel.stringValue = mediaItem.primaryDetailString;
+    self.detailLabel.stringValue = mediaItem.primaryDetailString ?: @"";
 
     NSURL * const artworkURL = inputItem.artworkURL;
     NSImage * const placeholderImage = [NSImage imageNamed:@"noart"];



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/eaa118fe468e2ce7d9f7f18bea9567dfa85a2277...91864bc5e96f1fac9c97d603fe6f97b74851e197

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/eaa118fe468e2ce7d9f7f18bea9567dfa85a2277...91864bc5e96f1fac9c97d603fe6f97b74851e197
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list