From 10f22d137c7738e3f1ddfe038df865e38fdf03ac Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Thu, 1 Jun 2023 15:15:36 -0700 Subject: [PATCH] Metadata: Fixes metadata reading metadataBlob may be null, so create dictionary in that case. Fixes #360 Signed-off-by: Christopher Snowhill --- Playlist/PlaylistEntry.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Playlist/PlaylistEntry.m b/Playlist/PlaylistEntry.m index 7b664a442..e3bd6a47e 100644 --- a/Playlist/PlaylistEntry.m +++ b/Playlist/PlaylistEntry.m @@ -503,7 +503,13 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) { self.error = YES; self.errorMessage = NSLocalizedStringFromTableInBundle(@"ErrorMetadata", nil, [NSBundle bundleForClass:[self class]], @""); } else { - NSMutableDictionary *metaDict = [self.metadataBlob mutableCopy]; + NSDictionary *originalDict = (NSDictionary * _Nullable) self.metadataBlob; + NSMutableDictionary *metaDict; + if(originalDict) { + metaDict = [originalDict mutableCopy]; + } else { + metaDict = [[NSMutableDictionary alloc] init]; + } self.volume = 1; for(NSString *key in metadata) { NSString *lowerKey = [key lowercaseString];