From 4a1b1a7025f4dde3dfb58a76b7fc1d7fffc0cdd4 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 30 Oct 2017 13:41:33 -0400 Subject: mq_web_view_*_scheme_methods.match_uri(): Handle NULL uri arguments --- diff --git a/src/web-view-schemes/normal.c b/src/web-view-schemes/normal.c index d0db097..16a7361 100644 --- a/src/web-view-schemes/normal.c +++ b/src/web-view-schemes/normal.c @@ -43,7 +43,7 @@ match_uri(const gchar *uri) { /* This is a catch-all scheme handler, so match any schemes not handled * by another handler. */ - return !g_str_has_prefix(uri, "view-source:"); + return !uri || !g_str_has_prefix(uri, "view-source:"); } static gchar * diff --git a/src/web-view-schemes/view-source.c b/src/web-view-schemes/view-source.c index f5619d1..8f7eff7 100644 --- a/src/web-view-schemes/view-source.c +++ b/src/web-view-schemes/view-source.c @@ -42,7 +42,7 @@ finalize(MqWebViewScheme *scheme) static gboolean match_uri(const gchar *uri) { - return g_str_has_prefix(uri, "view-source:"); + return uri && g_str_has_prefix(uri, "view-source:"); } static gchar * -- cgit v0.9.1