Don't try to check the prefix of a NULL URI

This commit is contained in:
Christian Dywan 2009-04-02 00:02:58 +02:00
parent 86292d26f9
commit 2d0e3b4c7e

View file

@ -2395,6 +2395,8 @@ midori_view_can_view_source (MidoriView* view)
&& !g_strrstr (view->mime_type, "xml")) && !g_strrstr (view->mime_type, "xml"))
return FALSE; return FALSE;
if (!uri)
return FALSE;
if (g_str_has_prefix (uri, "http://") || g_str_has_prefix (uri, "https://")) if (g_str_has_prefix (uri, "http://") || g_str_has_prefix (uri, "https://"))
return TRUE; return TRUE;
if (g_str_has_prefix (uri, "file://")) if (g_str_has_prefix (uri, "file://"))