Metadata: Fixes metadata reading
metadataBlob may be null, so create dictionary in that case. Fixes #360 Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
parent
877660b4cc
commit
10f22d137c
1 changed files with 7 additions and 1 deletions
|
@ -503,7 +503,13 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
|
||||||
self.error = YES;
|
self.error = YES;
|
||||||
self.errorMessage = NSLocalizedStringFromTableInBundle(@"ErrorMetadata", nil, [NSBundle bundleForClass:[self class]], @"");
|
self.errorMessage = NSLocalizedStringFromTableInBundle(@"ErrorMetadata", nil, [NSBundle bundleForClass:[self class]], @"");
|
||||||
} else {
|
} 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;
|
self.volume = 1;
|
||||||
for(NSString *key in metadata) {
|
for(NSString *key in metadata) {
|
||||||
NSString *lowerKey = [key lowercaseString];
|
NSString *lowerKey = [key lowercaseString];
|
||||||
|
|
Loading…
Reference in a new issue