Skip to content

NPE when processing Pneumonia doctor declaration without "mcPneumonieBacterienne" #14270

Description

@Pa-Touche

Bug Description

NPE: NullPointerException.

When trying to process a doctor declaration for the disease: PNEUMONIA, a NPE occurs when trying to access Boolean#booleanValue() of the field: "mcPneumonieBacterienne".
The bug is within the adapter.

According to the XSD this field is optional:

<xs:element name="mCPneumonieBacterienne" type="xs:boolean" minOccurs="0" />

Therefore this check should be using a safe variant like: org.apache.commons.lang3.BooleanUtils#isTrue.

The unboxing (booleanValue()) is done automatically within the condition, so replacing it with `BooleanUtils.isTrue(pneu.isMCPneumonieBacterienne()) will do the trick.

@XavCol can you please share the XML file on the Storage used with sormas.

Logs were attached on the Storage platform used by SORMAS.

Reproduction Steps

  1. Inject XML file (will be shared by @XavCol)

Expected Behavior

Message should be processed.

Affected Area(s)

Web app

SORMAS Version

1.104.0 & Adapter 0.3.0

Android version/Browser

Irrelevant

User Role(s)

SFTP

Server URL

Lux test server

Additional Information

No response

Metadata

Metadata

Assignees

Labels

bugAn error or misbehavior of an existing feature (ticket type)

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions