From 4d57e642a0c202b1e9718563c6faae2b481df24b Mon Sep 17 00:00:00 2001 From: Mutesasira Moses Date: Thu, 26 Oct 2023 16:36:59 +0300 Subject: [PATCH] catch NPE if IHS report params are empty --- .../implementation/DualInSituHybridizationReport.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/openelisglobal/reports/action/implementation/DualInSituHybridizationReport.java b/src/main/java/org/openelisglobal/reports/action/implementation/DualInSituHybridizationReport.java index b0fe1cc4f8..813f683142 100644 --- a/src/main/java/org/openelisglobal/reports/action/implementation/DualInSituHybridizationReport.java +++ b/src/main/java/org/openelisglobal/reports/action/implementation/DualInSituHybridizationReport.java @@ -23,10 +23,13 @@ protected void setAdditionalReportItems() { String reportDetails = MessageUtil.getMessage("dualInSitu.report.details", new String[] { form.getNumberOfcancerNuclei(), form.getAverageHer2(), form.getAverageChrom(), form.getIhcRatio() }); data.setIhcReportDetails(reportDetails); - if (form.getIhcScore().equals("AMPLIFICATION")) { - data.setIhcScore(MessageUtil.getMessage("dualInSitu.label.amp")); - } else { - data.setIhcScore(MessageUtil.getMessage("dualInSitu.label.noAmp")); + if (form.getIhcScore() != null) { + if (form.getIhcScore().equals("AMPLIFICATION")) { + data.setIhcScore(MessageUtil.getMessage("dualInSitu.label.amp")); + } else { + data.setIhcScore(MessageUtil.getMessage("dualInSitu.label.noAmp")); + } + } }