Skip to content

Commit 9c8b30e

Browse files
authored
Merge pull request #13741 from SORMAS-Foundation/bugfix-pathogen_test_form_npe
Fixed NPEs caused by List.of().contains(null) in PathogenTestForm.java
2 parents 95ff9d8 + 5c07881 commit 9c8b30e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sormas-ui/src/main/java/de/symeda/sormas/ui/samples/PathogenTestForm.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ private static void setCqValueVisibility(
244244
TextField cqValueField,
245245
PathogenTestType testType,
246246
PathogenTestResultType testResultType) {
247-
if (!List.of(Disease.TUBERCULOSIS).contains((Disease) diseaseField.getValue())) {
247+
248+
if (diseaseField.getValue() == null || !List.of(Disease.TUBERCULOSIS).contains((Disease) diseaseField.getValue())) {
248249
if (((testType == PathogenTestType.PCR_RT_PCR && testResultType == PathogenTestResultType.POSITIVE))
249250
|| testType == PathogenTestType.CQ_VALUE_DETECTION) {
250251
cqValueField.setVisible(true);
@@ -1211,7 +1212,7 @@ protected void addFields() {
12111212

12121213
updateDrugSusceptibilityFieldSpecifications(testType, (Disease) diseaseField.getValue());
12131214

1214-
if (!List.of(Disease.TUBERCULOSIS).contains((Disease) diseaseField.getValue())) {
1215+
if (diseaseField.getValue() == null || !List.of(Disease.TUBERCULOSIS).contains((Disease) diseaseField.getValue())) {
12151216
setVisibleClear(
12161217
PathogenTestType.PCR_RT_PCR == testType,
12171218
PathogenTestDto.CQ_VALUE,

0 commit comments

Comments
 (0)