Fixed: Using keyboard navigation in empty CPCollectionView threw exception.

This commit is contained in:
Stefan Wallström
2013-03-10 17:38:08 +01:00
parent 1a24e954f9
commit 2bf2442096
+4 -1
View File
@@ -1217,7 +1217,10 @@ Not supported. Use -collectionView:dataForItemsAtIndexes:fortype:
- (void)_modifySelectionWithNewIndex:(int)anIndex direction:(int)aDirection expand:(BOOL)shouldExpand
{
anIndex = MIN(MAX(anIndex, 0), [[self items] count] - 1);
var count = [[self items] count];
if (count === 0)
return;
anIndex = MIN(MAX(anIndex, 0), count - 1);
if (_allowsMultipleSelection && shouldExpand)
{