mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-10 10:42:19 +00:00
-[CPArrayController setContent:] would interpret nil as [nil].
When initializing a CPArrayController with a value that is not an array setContent: would make it an array by replacing value with [value]. This is consistent with how Cocoa does it, but it should first check to make sure that the content is not nil. If it is, the sensible thing to do (and what Cocoa does) is to replace it with an empty array. This commit also includes a missing import to make CPArrayControllerTest run without error.
This commit is contained in:
1 parent
99c1d18d95
commit
7bf2297125
3 files changed
+10
No files matched your search
@@ -150,6 +150,9 @@
|
||||
|
||||
- (void)setContent:(id)value
|
||||
{
|
||||
if (value == nil)
|
||||
value = [];
|
||||
|
||||
if (![value isKindOfClass:[CPArray class]])
|
||||
value = [value];
|
||||
|
||||
|
||||
Reference in new issue
Block a user