Don't throw an error if there's nothing to show

When the .flatpak directory doesn't exist,
there are no running instances.

Closes: #2027
Approved by: alexlarsson
This commit is contained in:
Matthias Clasen
2018-08-27 22:14:35 -04:00
committed by Atomic Bot
parent 03bb003f0f
commit 9e0f5dd79e

View File

@@ -234,7 +234,15 @@ enumerate_instances (const char *columns,
file = g_file_new_for_path (base_dir);
enumerator = g_file_enumerate_children (file, "standard::name", G_FILE_QUERY_INFO_NONE, NULL, error);
if (enumerator == NULL)
return FALSE;
{
if (g_error_matches (*error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
{
/* nothing to show */
g_clear_error (error);
return TRUE;
}
return FALSE;
}
while ((dir_info = g_file_enumerator_next_file (enumerator, NULL, error)) != NULL)
{