From 185ad5e747950ad90dcf4a445d3915e39991d8e9 Mon Sep 17 00:00:00 2001 From: Alexandre Wilhelm Date: Mon, 4 Apr 2016 06:48:26 -0700 Subject: [PATCH] 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. --- AppKit/CPTableHeaderView.j | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/AppKit/CPTableHeaderView.j b/AppKit/CPTableHeaderView.j index 58f5cb152..a9ec28a28 100644 --- a/AppKit/CPTableHeaderView.j +++ b/AppKit/CPTableHeaderView.j @@ -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