From eafbebcebb13de519b2780dee5cda755e337055a Mon Sep 17 00:00:00 2001 From: Antoine Mercadal Date: Mon, 16 Jan 2012 14:19:09 +0100 Subject: [PATCH] fix crash when setting title while to content view is set --- AppKit/CPBox.j | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AppKit/CPBox.j b/AppKit/CPBox.j index fb78bf85e..8151b33d6 100644 --- a/AppKit/CPBox.j +++ b/AppKit/CPBox.j @@ -352,6 +352,7 @@ CPBelowBottom = 6; [_titleView setAutoresizingMask:CPViewMinYMargin]; break; } + [self sizeToFit]; [self setNeedsDisplay:YES]; } @@ -361,6 +362,9 @@ CPBelowBottom = 6; var contentFrame = [_contentView frame], offset = [self _titleHeightOffset]; + if (!contentFrame) + return; + [_contentView setAutoresizingMask:CPViewNotSizable]; [self setFrameSize:CGSizeMake(contentFrame.size.width + _contentMargin.width * 2, contentFrame.size.height + _contentMargin.height * 2 + offset[0])];