FIXED: Crash when clicking on an empty CPTableView with variable row height.

Previously, clicking anywhere in an empty CPTableView with variable row height was causing a crash due to the code trying to find the latest cached row height. This patch adds a check to ensure the last cached row height is not nil.
This commit is contained in:
Antoine Mercadal committed 2014-01-23 12:56:39 -08:00
1 parent 047983d7bf
commit 1814f6b545
1 file changed
+1 -1
+1 -1
View File
@@ -2057,7 +2057,7 @@ NOT YET IMPLEMENTED
// search the (potentially large number of) rows for nothing.
var heightInfo = [_cachedRowHeights lastObject];
if (aPoint.y >= ROW_BOTTOM(heightInfo))
if (!heightInfo || aPoint.y >= ROW_BOTTOM(heightInfo))
return -1;
return [_cachedRowHeights indexOfObject:aPoint