From 31ed6254db6feba985ea0279bb83185087d37a2a Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Tue, 5 May 2009 13:20:35 -0700 Subject: [PATCH] Fix for null values in CPJSObjectCreateWithJSON. Closes #19 . --- Foundation/CPValue.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Foundation/CPValue.j b/Foundation/CPValue.j index bf7ce7c3f..87ba270b6 100644 --- a/Foundation/CPValue.j +++ b/Foundation/CPValue.j @@ -115,7 +115,7 @@ function CPJSObjectCreateJSON(aJSObject) // typeof new Number() and new String() gives you "object", // so valueof in those cases. var type = typeof aJSObject, - valueOf = aJSObject.valueOf(), + valueOf = aJSObject ? aJSObject.valueOf() : null, typeValueOf = typeof valueOf; if (type != typeValueOf)