src/JsRender/Gtk.vala
authorAlan Knowles <alan@roojs.com>
Thu, 28 May 2015 08:14:45 +0000 (16:14 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 28 May 2015 08:14:45 +0000 (16:14 +0800)
src/JsRender/Gtk.vala

index a4dfa0f..9c1d62a 100644 (file)
@@ -78,11 +78,17 @@ namespace JsRender {
                        print("load Items!\n");
                        if (this.tree != null) {
                                this.loaded = true;
+                               
                                return;
                        }
                        
                        print("load: %s\n" , this.path);
-
+                       if (!GLib.FileUtils.test(this.path, GLib.FileTest.EXISTS)) {
+                               // new file?!?
+                               this.tree = null;
+                               this.loaded = true;
+                               return;
+                       }
 
                        var pa = new Json.Parser();
                        pa.load_from_file(this.path);