B-Sides / ELCImagePickerController

A clone of the UIImagePickerController using the Assets Library Framework allowing for multiple asset selection
http://www.icodeblog.com
1.65k stars 469 forks source link

EXC_BAD_ACCESS When select a photo album without photos #26

Closed voicecho closed 11 years ago

voicecho commented 12 years ago

When I select a photo album without photos, "EXC_BAD_ACCESS" error appears in the following code in ELCAssetTablePicker.m

    [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:ceil(assetGroup.numberOfAssets / 4.0)-1 inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:NO];
dautermann commented 12 years ago

This bit of code looks suspicious:

ceil(assetGroup.numberOfAssets / 4.0)-1