diff --git a/content/io.js b/content/io.js index 1d705488..2087ea9a 100644 --- a/content/io.js +++ b/content/io.js @@ -118,10 +118,11 @@ vimperator.IO = function ()//{{{ else { newdir = this.expandPath(newdir); - if (!this.getFile(newdir).isDirectory()) + var file = this.getFile(newdir); + if (!file.exists() || !file.isDirectory()) { vimperator.echoerr("E344: Can't find directory \"" + newdir + "\" in path"); - return this.getCurrentDirectory(); + return null; } [cwd, oldcwd] = [newdir, cwd]; }