[gnome-commander/gcmd-1-8] Don't pring a critical warning in the terminal if devices or fav-apps file does not exist



commit d0398e601247d9016ef5b03a176237cd90265db5
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Sun Mar 4 18:15:47 2018 +0100

    Don't pring a critical warning in the terminal if devices or fav-apps file does not exist

 src/gnome-cmd-data.cc |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 6afc4f7..a6596ce 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -2199,7 +2199,11 @@ static inline void load_devices (const gchar *fname)
         g_build_filename (g_get_home_dir (), "." PACKAGE, fname, NULL);
 
     keyfile = gcmd_key_file_load_from_file(path, 0);
-    g_return_if_fail(keyfile != NULL);
+
+    if (keyfile == NULL)
+    {
+        return;
+    }
 
     groups = g_key_file_get_groups (keyfile, &length);
 
@@ -2330,7 +2334,11 @@ static void load_fav_apps (const gchar *fname)
     gnome_cmd_data.options.fav_apps = NULL;
 
     keyfile = gcmd_key_file_load_from_file(path, 0);
-    g_return_if_fail(keyfile != NULL);
+
+    if (keyfile == NULL)
+    {
+        return;
+    }
 
     groups = g_key_file_get_groups (keyfile, &length);
 


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