From 8867798f7a79dfa2a690602f5439a75448c7ccd7 Mon Sep 17 00:00:00 2001 From: "Ciprian Dorin, Craciun" Date: Sat, 28 Nov 2009 17:35:18 +0200 Subject: 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`. --- uzbl-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'uzbl-core.c') 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); -- cgit v1.2.3