]> git.saurik.com Git - cycript.git/blobdiff - Application.mm
Naming consistency.
[cycript.git] / Application.mm
index f14cb5ce17d5066bd2a41e5ed57b2729a7f4afc8..a5be46b39c2f9fa48676324738038a2105e40363 100644 (file)
@@ -38,9 +38,11 @@ int main() {
             result = exception;
         JSStringRelease(script);
 
-        CFStringRef json(JSValueToJSONCopy(JSGetContext(), result));
-        std::cout << [reinterpret_cast<const NSString *>(json) UTF8String] << std::endl;
-        CFRelease(json);
+        if (!JSValueIsUndefined(JSGetContext(), result)) {
+            CFStringRef json(JSValueToJSONCopy(JSGetContext(), result));
+            std::cout << [reinterpret_cast<const NSString *>(json) UTF8String] << std::endl;
+            CFRelease(json);
+        }
 
         [pool release];
     }