From: Jay Freeman (saurik) Date: Thu, 4 Mar 2010 05:55:43 +0000 (+0000) Subject: Added a weird nil-specific toString() check. X-Git-Tag: v0.9.432~112 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/7db9993afae779bc6ade7e23b53aac1aca1e16dc Added a weird nil-specific toString() check. --- 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]));