Skip to content

Commit

Permalink
Make it null if nil
Browse files Browse the repository at this point in the history
  • Loading branch information
FrikkieSnyman committed Nov 15, 2019
1 parent a7bb4d0 commit 057996c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions ios/RNPhotosFramework/PHCollectionService.m
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ +(NSMutableDictionary *)generateAlbumsResponseFromParams:(NSDictionary *)params
+ (NSMutableDictionary *)generateAlbumResponseFromCollection:(PHCollection *)collection numberOfPreviewAssets:(int)numberOfPreviewAssets countType:(RNPFAssetCountType)countType includeMetadata:(BOOL)includeMetadata includeResourcesMetadata:(BOOL)resourcesMetadata cacheAssets:(BOOL)cacheAssets assetFetchParams:(NSDictionary *)assetFetchParams {

NSMutableDictionary *albumDictionary = [NSMutableDictionary new];

if([collection isKindOfClass:[PHAssetCollection class]]) {
PHAssetCollection *phAssetCollection = (PHAssetCollection *)collection;
PHAssetCollectionType albumType = [phAssetCollection assetCollectionType];
Expand Down Expand Up @@ -186,12 +186,8 @@ + (NSMutableDictionary *)generateAlbumResponseFromCollection:(PHCollection *)col

}
}

NSString *title = collection.localizedTitle;
if (!title) {
title = @"Unknown";
}
[albumDictionary setObject:title forKey:@"title"];

[albumDictionary setObject:ObjectOrNull(collection.localizedTitle) forKey:@"title"];
[albumDictionary setObject:collection.localIdentifier forKey:@"localIdentifier"];

NSMutableArray *permittedOperations = [NSMutableArray arrayWithCapacity:7];
Expand Down

0 comments on commit 057996c

Please sign in to comment.