Skip to content

Commit cf2c0f1

Browse files
author
yuzheng
committed
fix: don't access album cover when album is empty
1 parent 3357eab commit cf2c0f1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

TZImagePickerController/TZImagePickerController/TZImageManager.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ - (PHImageRequestID)getPostImageWithAlbumModel:(TZAlbumModel *)model completion:
412412
if (!self.sortAscendingByModificationDate) {
413413
asset = [model.result firstObject];
414414
}
415+
if (!asset) {
416+
return -1;
417+
}
415418
return [[TZImageManager manager] getPhotoWithAsset:asset photoWidth:80 completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
416419
if (completion) completion(photo);
417420
}];

0 commit comments

Comments
 (0)