File tree Expand file tree Collapse file tree
extensions/ql-vscode/src/variant-analysis Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -199,34 +199,35 @@ export class VariantAnalysisResultsManager extends DisposableObject {
199199 ) ;
200200 const sarifPath = join ( resultsDirectory , "results.sarif" ) ;
201201 const bqrsPath = join ( resultsDirectory , "results.bqrs" ) ;
202+
203+ let interpretedResults : AnalysisAlert [ ] | undefined ;
204+ let rawResults : AnalysisRawResults | undefined ;
205+
202206 if ( await pathExists ( sarifPath ) ) {
203- const interpretedResults = await this . readSarifResults (
207+ interpretedResults = await this . readSarifResults (
204208 sarifPath ,
205209 fileLinkPrefix ,
206210 ) ;
207-
208- return {
209- variantAnalysisId,
210- repositoryId : repoTask . repository . id ,
211- interpretedResults,
212- } ;
213211 }
214212
215213 if ( await pathExists ( bqrsPath ) ) {
216- const rawResults = await this . readBqrsResults (
214+ rawResults = await this . readBqrsResults (
217215 bqrsPath ,
218216 fileLinkPrefix ,
219217 repoTask . sourceLocationPrefix ,
220218 ) ;
219+ }
221220
222- return {
223- variantAnalysisId,
224- repositoryId : repoTask . repository . id ,
225- rawResults,
226- } ;
221+ if ( ! interpretedResults && ! rawResults ) {
222+ throw new Error ( "Missing results file" ) ;
227223 }
228224
229- throw new Error ( "Missing results file" ) ;
225+ return {
226+ variantAnalysisId,
227+ repositoryId : repoTask . repository . id ,
228+ interpretedResults,
229+ rawResults,
230+ } ;
230231 }
231232
232233 public async isVariantAnalysisRepoDownloaded (
You can’t perform that action at this time.
0 commit comments