add check if expected directory path is non-empty string

This commit is contained in:
Vladimir Matveev 2016-09-21 00:02:20 -07:00
parent 53232b9680
commit 2a206b3dd7

View file

@ -611,7 +611,7 @@ namespace ts {
const originalWriteFile = sys.writeFile;
sys.writeFile = function(path, data, writeBom) {
const directoryPath = getDirectoryPath(normalizeSlashes(path));
if (!sys.directoryExists(directoryPath)) {
if (directoryPath && !sys.directoryExists(directoryPath)) {
recursiveCreateDirectory(directoryPath, sys);
}
originalWriteFile.call(sys, path, data, writeBom);