mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-05 16:42:58 +00:00
Fixed: [CPBox setContentView:nil] crash.
This is allowed in Cocoa so should not crash Cappuccino either.
This commit is contained in:
1 parent
7ab84ca607
commit
09b5eef617
1 file changed
+8
-1
+8
-1
@@ -287,7 +287,14 @@ CPBelowBottom = 6;
|
||||
|
||||
[aView setFrame:CGRectInset([self bounds], contentMargin.width + borderWidth, contentMargin.height + borderWidth)];
|
||||
[aView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
|
||||
[self replaceSubview:_contentView with:aView];
|
||||
|
||||
// A nil contentView is allowed (tested in Cocoa 2013-02-22).
|
||||
if (!aView)
|
||||
[_contentView removeFromSuperview];
|
||||
else if (_contentView)
|
||||
[self replaceSubview:_contentView with:aView];
|
||||
else
|
||||
[self addSubview:aView];
|
||||
|
||||
_contentView = aView;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user