Skip to content

Commit 3ebcbd4

Browse files
author
Andy
authored
Handle diagnostic with unknown file (microsoft#23681)
1 parent ec05f29 commit 3ebcbd4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/buildProtocol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ function writeProtocolFile(outputFile: string, protocolTs: string, typeScriptSer
178178
ts.sys.writeFile(outputFile, protocolDts);
179179

180180
if (diagnostics.length) {
181-
const flattenedDiagnostics = diagnostics.map(d => `${ts.flattenDiagnosticMessageText(d.messageText, "\n")} at ${d.file.fileName} line ${d.start}`).join("\n");
181+
const flattenedDiagnostics = diagnostics.map(d => `${ts.flattenDiagnosticMessageText(d.messageText, "\n")} at ${d.file ? d.file.fileName : "<unknown>"} line ${d.start}`).join("\n");
182182
throw new Error(`Unexpected errors during sanity check: ${flattenedDiagnostics}`);
183183
}
184184
}

0 commit comments

Comments
 (0)