Skip to content

Commit

Permalink
Some checks produce results with file, but without sample. Make the c…
Browse files Browse the repository at this point in the history
…heck more robust.
  • Loading branch information
JarLob committed Feb 8, 2021
1 parent 9c705bd commit ba73cfd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ export function writeIssues(root, isRelative, filename, result, isSarif){
uri: issue.file !== "N/A" ? issue.file : "file:///"
},
region: {
startLine: issue.file !== "N/A" ? issue.location.line : 1,
startColumn: issue.file !== "N/A" ? issue.location.column + 1 : 1, // sarif columns start from 1
charLength: issue.file !== "N/A" ? issue.sample.length : 0
startLine: issue.location.line,
startColumn: issue.location.column + 1, // sarif columns start from 1
charLength: issue.sample ? issue.sample.length : 0
}
}
}
Expand Down

0 comments on commit ba73cfd

Please sign in to comment.