resources/RooUsage.txt
[app.Builder.js] / src / Builder4 / DialogPluginWebkit.vala
index 6fb729d..e4c46f4 100644 (file)
@@ -117,12 +117,14 @@ public class Xcls_DialogPluginWebkit : Object
             // need to modify paths
     
             string inhtml;
+            try {
+                GLib.FileUtils.get_contents(
+                    BuilderApplication.configDirectory() + "/resources/roo.builder.html"
+                        , out inhtml);
             
-            GLib.FileUtils.get_contents(
-                BuilderApplication.configDirectory() + "/resources/roo.builder.html"
-                    , out inhtml);
-            
-            
+            } catch (Error e) {
+                inhtml = "";
+            }
             // fetch the json from the database...
             
             //print(runhtml);
@@ -151,14 +153,19 @@ public class Xcls_DialogPluginWebkit : Object
              if (response_id == 1) { // OK...
                  var loop = new MainLoop();
                  // run toBJS to get the data... (calls back into alert handler)
-                   this.webview.el.run_javascript.begin("Editor." + cls + ".panel.toBJS();", null, (obj, res) => {
-    
-                     this.webview.el.run_javascript.end(res);
-    
-                        loop.quit();
-                    });
-                 loop.run();
-                 ret = _this.result_json;
+                    _this.result_json = "";
+                     this.webview.el.run_javascript.begin("Editor." + cls + ".panel.toBJS();", null, (obj, res) => {
+                         try {
+                            this.webview.el.run_javascript.end(res);
+                        } catch(Error e) {
+                    
+                         }
+                         loop.quit();
+                     });
+                     loop.run();
+                     ret = _this.result_json;
+                     
+                 
         //           print("LOOP END?");
                  // try and get the resopse...
                 break;