Fix for -description in CPArray containing null or undefined values.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I committed 2009-06-13 11:42:22 -07:00
1 parent 787e0c8afd
commit 38273e4dab
1 file changed
+13 -8
+13 -8
View File
@@ -787,18 +787,23 @@
*/
- (CPString)description
{
var i = 0,
var index = 0,
count = [self count],
description = '(';
for(; i < count; ++i)
for(; index < count; ++index)
{
if (self[i].isa) description += [self[i] description];
else description += self[i];
if (i != count - 1) description += ", ";
var object = self[index];
if (object && object.isa)
description += [object description];
else
description += object;
if (index !== count - 1)
description += ", ";
}
return description + ')';
}