[Xfce4-commits] <midori:master> NULL-check exception in sokoke_js_script_eval

Christian Dywan noreply at xfce.org
Fri Nov 13 02:24:01 CET 2009


Updating branch refs/heads/master
         to 2fc6a2be891509e16654dd5af8e0af562db7a579 (commit)
       from 55e50e20b1626e93b6b26549b51a9bd88d6cde6d (commit)

commit 2fc6a2be891509e16654dd5af8e0af562db7a579
Author: Christian Dywan <christian at twotoasts.de>
Date:   Thu Nov 12 23:48:19 2009 +0100

    NULL-check exception in sokoke_js_script_eval

 extensions/formhistory.c |    3 +--
 midori/sokoke.c          |    3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/extensions/formhistory.c b/extensions/formhistory.c
index f0a369b..8e1a2cc 100644
--- a/extensions/formhistory.c
+++ b/extensions/formhistory.c
@@ -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");
diff --git a/midori/sokoke.c b/midori/sokoke.c
index b831579..2f48816 100644
--- a/midori/sokoke.c
+++ b/midori/sokoke.c
@@ -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);
     }



More information about the Xfce4-commits mailing list