Skip to content

Commit

Permalink
fix: Resolve NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
awarecan committed Aug 19, 2020
1 parent 424fe49 commit 2c47436
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ export async function run(fileNames: string[], options: ts.CompilerOptions): Pro
allDiagnostics.forEach(diagnostic => {
if (!diagnostic.file) {
console.log(diagnostic)
} else {
const {line, character} = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start)
const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n')
console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`)
}
const {line, character} = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start)
const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n')
console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`)
})

if (emitResult.emitSkipped) {
Expand Down

0 comments on commit 2c47436

Please sign in to comment.