Skip to content

Commit

Permalink
Merge pull request #1641 from csordasmarton/fix-gui-no-report
Browse files Browse the repository at this point in the history
Fix non existing report in the GUI
  • Loading branch information
gyorb authored Jul 10, 2018
2 parents 8b6abe5 + b5f45b1 commit 49b5965
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions www/scripts/codecheckerviewer/ListOfBugs.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,12 @@ function (declare, dom, style, Deferred, ObjectStore, Store, QueryResults,
if (sender && sender !== that._grid)
return;

if (reportData !== null && !(reportData instanceof CC_OBJECTS.ReportData))
reportData = CC_SERVICE.getReport(reportData);
if (reportData !== null &&
!(reportData instanceof CC_OBJECTS.ReportData)) {
try {
reportData = CC_SERVICE.getReport(reportData);
} catch (ex) { console.warn(ex); }
}

var getAndUseReportHash = reportHash && (!reportData ||
reportData.reportId === null || reportData.bugHash !== reportHash);
Expand All @@ -484,7 +488,7 @@ function (declare, dom, style, Deferred, ObjectStore, Store, QueryResults,
reportFilter.reportHash = [reportHash];
reportFilter.isUnique = false;

if (reportData)
if (reportData && reportData.checkedFile)
reportFilter.filepath = ['*' + reportData.checkedFile];

// We set a sort option to select a report which has the shortest
Expand Down Expand Up @@ -516,6 +520,16 @@ function (declare, dom, style, Deferred, ObjectStore, Store, QueryResults,

that.reportData = reportData;

// No report has been found.
if (!reportData) {
console.warn('No report can be found: ' + reportHash);
hashHelper.setStateValues({
'reportHash' : null,
'report' : null
});
return;
}

var filename = reportData.checkedFile.substr(
reportData.checkedFile.lastIndexOf('/') + 1);

Expand Down

0 comments on commit 49b5965

Please sign in to comment.