Return original URI if unescaping failed

The issue could be seen in the form of error messages:

g_regex_replace_eval: assertion `string != NULL' failed
This commit is contained in:
Alexander Butenko 2011-06-01 18:21:51 -04:00 committed by Christian Dywan
parent 4bfbe5b30e
commit 243f93b70d

View file

@ -926,6 +926,8 @@ sokoke_uri_unescape_string (const gchar* uri)
{
/* Preserve %20 for pasting URLs into other windows */
gchar* unescaped = g_uri_unescape_string (uri, "+");
if (!unescaped)
return g_strdup (uri);
gchar* spaced = sokoke_replace_variables (unescaped, " ", "%20", NULL);
g_free (unescaped);
return spaced;