Commit 7fc99223 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

Fix runtime exception

(cherry picked from commit c94a9578)
parent cddcabb7
......@@ -719,15 +719,20 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
[tableView deselectRowAtIndexPath:indexPath animated:YES];
NSManagedObject *selectedObject;
if (tableView == self.searchDisplayController.searchResultsTableView)
selectedObject = _searchData[indexPath.row];
else
selectedObject = _foundMedia[indexPath.row];
NSUInteger row = indexPath.row;
if (tableView == self.searchDisplayController.searchResultsTableView) {
if (row < _searchData.count)
selectedObject = _searchData[row];
} else {
if (row < _foundMedia.count)
selectedObject = _foundMedia[row];
}
if (_searchDisplayController.active)
[_searchDisplayController setActive:NO animated:NO];
[self openMediaObject:selectedObject];
if (selectedObject != nil)
[self openMediaObject:selectedObject];
}
#pragma mark - Gesture Action
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment