[epiphany] profile-migrator: Fix GFileEnumerator error handling



commit 40992f9616d196162383c13f0ebb11eec5ed535b
Author: Phaedrus Leeds <mwleeds protonmail com>
Date:   Wed Feb 23 10:48:28 2022 -0800

    profile-migrator: Fix GFileEnumerator error handling
    
    Don't dereference a NULL GError in case the directory being iterated
    over is empty. This probably hasn't come up in practice since
    ~/.local/share is hardly ever empty.

 src/profile-migrator/ephy-profile-migrator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/profile-migrator/ephy-profile-migrator.c b/src/profile-migrator/ephy-profile-migrator.c
index 33939e507..8267d3fd0 100644
--- a/src/profile-migrator/ephy-profile-migrator.c
+++ b/src/profile-migrator/ephy-profile-migrator.c
@@ -1305,7 +1305,7 @@ migrate_webapp_names (void)
     return;
 
   info = g_file_enumerator_next_file (children, NULL, &error);
-  if (!info) {
+  if (error) {
     g_warning ("Cannot enumerate profile directory: %s", error->message);
     return;
   }
@@ -1520,7 +1520,7 @@ migrate_pre_flatpak_webapps (void)
   }
 
   info = g_file_enumerator_next_file (children, NULL, &error);
-  if (!info) {
+  if (error) {
     g_warning ("Cannot enumerate profile directory: %s", error->message);
     return;
   }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]