Browse Source

fix when startup on an invalid directory

Nicolas Cannasse 6 years ago
parent
commit
aa050197a9
1 changed files with 6 additions and 0 deletions
  1. 6 0
      hide/Ide.hx

+ 6 - 0
hide/Ide.hx

@@ -102,6 +102,12 @@ class Ide {
 
 		fileWatcher = new hide.tools.FileWatcher();
 
+		if( !sys.FileSystem.exists(ideConfig.currentProject) || !sys.FileSystem.isDirectory(ideConfig.currentProject) ) {
+			js.Browser.alert(ideConfig.currentProject+" no longer exists");
+			ideConfig.currentProject = cwd;
+			config.global.save();
+		}
+
 		setProject(ideConfig.currentProject);
 		window.window.document.addEventListener("mousedown", function(e) {
 			mouseX = e.x;