mirror of
https://github.com/flatpak/flatpak.git
synced 2026-03-17 14:39:13 -04:00
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:
committed by
Atomic Bot
parent
03bb003f0f
commit
9e0f5dd79e
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user