aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl-core.c
diff options
context:
space:
mode:
authorGravatar Ciprian Dorin, Craciun <ciprian@volution.ro>2009-11-28 17:35:18 +0200
committerGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-12-01 22:06:38 +0100
commit8867798f7a79dfa2a690602f5439a75448c7ccd7 (patch)
treead435f11d7c309194bb3e5276b23dc53222789a2 /uzbl-core.c
parent090845c0a98658a548b470289b896fccc989dae2 (diff)
Fixed `run_handler (const gchar *act, const gchar *args)` by checking if `act` is not `NULL` or empty.
It seems that there are a number of "hooks" that are executed when something happens (like accessing an url), but usually by default these hooks are not set (thus NULL), and g_strsilit gives an NULL assertion warning. Also we should check if `act` was not an empty string, thus `parts[0]` beeing `NULL`.
Diffstat (limited to 'uzbl-core.c')
-rw-r--r--uzbl-core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/uzbl-core.c b/uzbl-core.c
index 6be2c7c..d14764f 100644
--- a/uzbl-core.c
+++ b/uzbl-core.c
@@ -2107,8 +2107,9 @@ run_handler (const gchar *act, const gchar *args) {
it still isn't perfect for chain actions.. will reconsider & re-
factor when I have the time. -duc */
+ if (!act) return;
char **parts = g_strsplit(act, " ", 2);
- if (!parts) return;
+ if (!parts || !parts[0]) return;
if (g_strcmp0(parts[0], "chain") == 0) {
GString *newargs = g_string_new("");
gchar **chainparts = split_quoted(parts[1], FALSE);