From 7db9993afae779bc6ade7e23b53aac1aca1e16dc Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 4 Mar 2010 05:55:43 +0000 Subject: [PATCH] Added a weird nil-specific toString() check. --- ObjectiveC/Library.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index bd5ccdf..41110cc 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -2185,6 +2185,10 @@ static JSValueRef Instance_callAsFunction_toString(JSContextRef context, JSObjec Instance *internal(reinterpret_cast(JSObjectGetPrivate(_this))); + id value(internal->GetValue()); + if (value == nil) + return CYCastJSValue(context, "nil"); + CYPoolTry { // XXX: this seems like a stupid implementation; what if it crashes? why not use the CYONifier backend? return CYCastJSValue(context, CYJSString(context, [internal->GetValue() description])); -- 2.45.2