2007-10-07 Eric Seidel <eric@webkit.org>
authoroliver <oliver@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Oct 2007 15:30:43 +0000 (15:30 +0000)
committeroliver <oliver@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Oct 2007 15:30:43 +0000 (15:30 +0000)
        Reviewed by darin.

        * Drosera/mac/DebuggerDocumentPlatform.mm:
        (DebuggerDocument::platformEvaluateScript): null check before trying to make a JSString

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@26519 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/Drosera/mac/DebuggerDocumentPlatform.mm

index 9e551fa1a9483f22e2ad30c6e1e970234db7b71b..1391354854e65bc1b62abefca582ffd34d3c7912 100644 (file)
@@ -1,3 +1,10 @@
+2007-10-07  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by darin.
+
+        * Drosera/mac/DebuggerDocumentPlatform.mm:
+        (DebuggerDocument::platformEvaluateScript): null check before trying to make a JSString
+
 2007-10-03  Rob Buis  <buis@kde.org>
 
         Reviewed by Olliej.
index 841f4246894a5d2b7a6fe66f23b6d82fdbb94ce8..99b7520273897e07811ba48bb61763aeedd65fe1 100644 (file)
@@ -104,8 +104,11 @@ JSValueRef DebuggerDocument::platformEvaluateScript(JSContextRef context, JSStri
     
     RetainPtr<NSString *> scriptNS(AdoptNS, NSStringCreateWithJSStringRef(script));
     id value = [cframe evaluateWebScript:scriptNS.get()];
+    NSString *result = [NSString stringOrNilFromWebScriptResult:value];
+    if (!result)
+        return JSValueMakeNull(context);
 
-    return JSValueRefCreateWithNSString(context, [NSString stringOrNilFromWebScriptResult:value]);
+    return JSValueRefCreateWithNSString(context, result);
 }
 
 void DebuggerDocument::getPlatformCurrentFunctionStack(JSContextRef context, Vector<JSValueRef>& currentStack)