From 2fc6a2be891509e16654dd5af8e0af562db7a579 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Thu, 12 Nov 2009 23:48:19 +0100 Subject: [PATCH] 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 f0a369b5..8e1a2cc4 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 b831579a..2f488160 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); } -- 2.39.5