浏览代码

fix when startup on an invalid directory

Nicolas Cannasse 6 年之前
父节点
当前提交
aa050197a9
共有 1 个文件被更改,包括 6 次插入0 次删除
  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;