From 0e8d60ba3cff7bdf763171243534c00b1d67e199 Mon Sep 17 00:00:00 2001 From: Eric Warmenhoven Date: Wed, 6 Mar 2024 17:37:11 -0500 Subject: [PATCH] tvOS: fix a crash when a history playlist item does not have a label (#16336) --- ui/drivers/cocoa/cocoa_common.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/drivers/cocoa/cocoa_common.m b/ui/drivers/cocoa/cocoa_common.m index d10cc46b1c..61eee83a16 100644 --- a/ui/drivers/cocoa/cocoa_common.m +++ b/ui/drivers/cocoa/cocoa_common.m @@ -905,7 +905,8 @@ static NSDictionary *topshelfDictForEntry(const struct playlist_entry *entry, gf { NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:@{ @"id": [NSString stringWithUTF8String:entry->path], - @"title": [NSString stringWithUTF8String:entry->label], + @"title": [NSString stringWithUTF8String: + (string_is_empty(entry->label) ? path_basename(entry->path) : entry->label)], }]; if (!string_is_empty(path_data->content_db_name)) {