Skip to content

Commit

Permalink
Merge pull request #566 from mozzy11/2.8
Browse files Browse the repository at this point in the history
fix NPE on pathology when no test results exits
  • Loading branch information
mozzy11 authored Sep 26, 2023
2 parents 33cf5fa + 9370430 commit 30ab7ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/resultPage/SearchResultForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ export function SearchResults(props) {
page={page}
pageSize={pageSize}
pageSizes={[100]}
totalItems={props.results.testResult.length}
totalItems={props.results.testResult?.length}
></Pagination>

<Button type="button" id="submit" onClick={handleSave}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,11 @@ private void referToImmunoHistoChemistry(PathologySample pathologySample, Pathol
if (immunoHistologyTest == null) {
return;
}

Analysis currentAnalysis = analysisService.getAnalysesBySampleId(pathologySample.getSample().getId()).get(0);
List<Analysis> analyses = analysisService.getAnalysesBySampleId(pathologySample.getSample().getId());
if(analyses == null || analyses.isEmpty()){
return;
}
Analysis currentAnalysis = analyses.get(0);
Analysis analysis = new Analysis();
analysis.setTest(immunoHistologyTest);
analysis.setIsReportable(currentAnalysis.getIsReportable());
Expand Down

0 comments on commit 30ab7ed

Please sign in to comment.