src/Application.vala
authorAlan Knowles <alan@roojs.com>
Sat, 3 Sep 2022 10:43:58 +0000 (18:43 +0800)
committerAlan Knowles <alan@roojs.com>
Sat, 3 Sep 2022 10:43:58 +0000 (18:43 +0800)
src/Application.vala

index dc46873..117f452 100644 (file)
                                 return new AppSettings();
                        }
                        string data; 
-                       FileUtils.get_contents(setting_file, out data);
-                       return Json.gobject_from_data (typeof (AppSettings), data) as AppSettings;
+                       try { 
+                               FileUtils.get_contents(setting_file, out data);
+                               return Json.gobject_from_data (typeof (AppSettings), data) as AppSettings;
+                       } catch (Error e) {
+                       }
+                       return new AppSettings();
                }
                public void save()
                {