From 2a206b3dd7770246db1254ca113dad8ba22c29af Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Wed, 21 Sep 2016 00:02:20 -0700 Subject: [PATCH] add check if expected directory path is non-empty string --- src/compiler/sys.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index f930ce295f..ea858e21fb 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -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);