Fixed: crash when having a CPTableViewHeader without a CPTableView

Previously, when having a CPTableViewHeader without a CPTableView, cappuccino just crashed.
We now check if _tableView is set before iterating on the tableview's columns.
This commit is contained in:
Alexandre Wilhelm committed 2016-04-04 06:48:26 -07:00
1 parent 42d7e4312b
commit 185ad5e747
1 file changed
+5 -2
+5 -2
View File
@@ -466,9 +466,12 @@ var CPTableHeaderViewResizeZone = 3.0,
- (void)updateTrackingAreas
{
[self removeAllTrackingAreas];
var options = CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow;
if (!_tableView)
return;
for (var i = 0; i < _tableView._tableColumns.length; i++)
[self addTrackingArea:[[CPTrackingArea alloc] initWithRect:[self _cursorRectForColumn:i]
options:options