From a549c191da02e732afc560d9b4f45c8c82b29423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Wallstro=CC=88m?= Date: Mon, 11 Mar 2013 21:09:22 +0100 Subject: [PATCH] lint --- AppKit/CPCollectionView.j | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AppKit/CPCollectionView.j b/AppKit/CPCollectionView.j index 98a2ea69b..58f39bd1f 100644 --- a/AppKit/CPCollectionView.j +++ b/AppKit/CPCollectionView.j @@ -1218,8 +1218,10 @@ Not supported. Use -collectionView:dataForItemsAtIndexes:fortype: - (void)_modifySelectionWithNewIndex:(int)anIndex direction:(int)aDirection expand:(BOOL)shouldExpand { var count = [[self items] count]; + if (count === 0) return; + anIndex = MIN(MAX(anIndex, 0), count - 1); if (_allowsMultipleSelection && shouldExpand)