Skip to content

Commit

Permalink
Merge pull request #12 from relivecc/nil-check-for-album-title
Browse files Browse the repository at this point in the history
Set title to Unknown if it's nil
  • Loading branch information
FrikkieSnyman authored Nov 15, 2019
2 parents c543fb4 + 057996c commit d1a9922
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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,8 +186,8 @@ + (NSMutableDictionary *)generateAlbumResponseFromCollection:(PHCollection *)col

}
}
[albumDictionary setObject:collection.localizedTitle 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 d1a9922

Please sign in to comment.