Skip to content

Commit

Permalink
Fix NPE in UpnpIOServiceImpl (openhab#4038)
Browse files Browse the repository at this point in the history
Fix openhab#4037

Signed-off-by: Jan N. Klug <[email protected]>
  • Loading branch information
J-N-K authored Jan 14, 2024
1 parent 6495f4e commit a6401fa
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,13 @@ protected void eventReceived(GENASubscription sub) {
for (UpnpIOParticipant participant : participants) {
if (Objects.equals(getDevice(participant), deviceRoot)) {
for (Entry<String, StateVariableValue> entry : values.entrySet()) {
try {
participant.onValueReceived(entry.getKey(), entry.getValue().getValue().toString(),
serviceId);
} catch (Exception e) {
logger.error("Participant threw an exception onValueReceived", e);
Object value = entry.getValue().getValue();
if (value != null) {
try {
participant.onValueReceived(entry.getKey(), value.toString(), serviceId);
} catch (Exception e) {
logger.error("Participant threw an exception onValueReceived", e);
}
}
}
break;
Expand Down

0 comments on commit a6401fa

Please sign in to comment.