forked from AuroraMiddleware/gtk
Fix a possible crash in gtk_show_uri
g_file_get_basename can return NULL. Deal with it somehow. Fixes: #3883
This commit is contained in:
parent
435ed3158c
commit
ce2a433ca1
@ -45,6 +45,9 @@ get_display_name (GFile *file,
|
|||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
{
|
{
|
||||||
name = g_file_get_basename (file);
|
name = g_file_get_basename (file);
|
||||||
|
if (name == NULL)
|
||||||
|
name = g_file_get_uri (file);
|
||||||
|
|
||||||
if (!g_utf8_validate (name, -1, NULL))
|
if (!g_utf8_validate (name, -1, NULL))
|
||||||
{
|
{
|
||||||
tmp = name;
|
tmp = name;
|
||||||
|
Loading…
Reference in New Issue
Block a user