From 4b764dc8b4e1a6ca67299616f15bb8a9b525e793 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Fri, 17 Feb 2012 16:25:16 +0000 Subject: [PATCH] Throw an exception when trying to set a null minimum item size for a collection view. --- AppKit/CPCollectionView.j | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AppKit/CPCollectionView.j b/AppKit/CPCollectionView.j index 0cb99d091..ddcd12e5c 100644 --- a/AppKit/CPCollectionView.j +++ b/AppKit/CPCollectionView.j @@ -475,7 +475,7 @@ } var superview = [self superview], - proposedHeight = y + itemSize.height + _verticalMargin; + proposedHeight = y + itemSize.height + _verticalMargin; if ([superview isKindOfClass:[CPClipView class]]) { @@ -561,6 +561,8 @@ */ - (void)setMinItemSize:(CGSize)aSize { + if (aSize === nil || aSize === undefined) + [CPException raise:CPInvalidArgumentException reason:"Invalid value provided for minimum size"]; if (CGSizeEqualToSize(_minItemSize, aSize)) return;