]> spindle.queued.net Git - midori/commitdiff
NULL-check exception in sokoke_js_script_eval
authorChristian Dywan <christian@twotoasts.de>
Thu, 12 Nov 2009 22:48:19 +0000 (23:48 +0100)
committerChristian Dywan <christian@twotoasts.de>
Thu, 12 Nov 2009 22:55:36 +0000 (23:55 +0100)
extensions/formhistory.c
midori/sokoke.c

index f0a369b52fc4d2058506181d6b7796c0fa72b5f5..8e1a2cc41cf3a19ff90bbaee797d90e1c31ef427 100644 (file)
@@ -191,7 +191,6 @@ formhistory_navigation_decision_cb (WebKitWebView*             web_view,
                                     WebKitWebPolicyDecision*   decision,
                                     MidoriExtension*           extension)
 {
-    gchar* exception;
     JSContextRef js_context = webkit_web_frame_get_global_context (web_frame);
     /* The script returns form data in the form "field_name|,|value|,|field_type".
        We are handling only input fields with 'text' or 'password' type.
@@ -214,7 +213,7 @@ formhistory_navigation_decision_cb (WebKitWebView*             web_view,
     if (webkit_web_navigation_action_get_reason (action) == WEBKIT_WEB_NAVIGATION_REASON_FORM_SUBMITTED
      || webkit_web_navigation_action_get_reason (action) == WEBKIT_WEB_NAVIGATION_REASON_FORM_RESUBMITTED)
     {
-        gchar* value = sokoke_js_script_eval (js_context, script, &exception);
+        gchar* value = sokoke_js_script_eval (js_context, script, NULL);
         if (value)
         {
             gpointer db = g_object_get_data (G_OBJECT (extension), "formhistory-db");
index b831579a024406cc92cca289abdc4db6e37d3047..2f488160c9e5d3cc1674f3630253b23ba940f1c3 100644 (file)
@@ -73,7 +73,8 @@ sokoke_js_script_eval (JSContextRef js_context,
     {
         JSStringRef js_message = JSValueToStringCopy (js_context,
                                                       js_exception, NULL);
-        *exception = sokoke_js_string_utf8 (js_message);
+        if (exception)
+            *exception = sokoke_js_string_utf8 (js_message);
         JSStringRelease (js_message);
         js_value = JSValueMakeNull (js_context);
     }