Skip to content

Commit 2a206b3

Browse files
committed
add check if expected directory path is non-empty string
1 parent 53232b9 commit 2a206b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/sys.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ namespace ts {
611611
const originalWriteFile = sys.writeFile;
612612
sys.writeFile = function(path, data, writeBom) {
613613
const directoryPath = getDirectoryPath(normalizeSlashes(path));
614-
if (!sys.directoryExists(directoryPath)) {
614+
if (directoryPath && !sys.directoryExists(directoryPath)) {
615615
recursiveCreateDirectory(directoryPath, sys);
616616
}
617617
originalWriteFile.call(sys, path, data, writeBom);

0 commit comments

Comments
 (0)