From 1cda64322327adacbc4ebed55fef9c5a4bece402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20M=C3=BCltin?= Date: Wed, 23 Aug 2017 11:29:07 +0200 Subject: [PATCH] Avoid NullPointerException in WaitForSupportedAppProtocolRes.java --- .../risev2g/evcc/states/WaitForSupportedAppProtocolRes.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RISE-V2G-EVCC/src/main/java/org/v2gclarity/risev2g/evcc/states/WaitForSupportedAppProtocolRes.java b/RISE-V2G-EVCC/src/main/java/org/v2gclarity/risev2g/evcc/states/WaitForSupportedAppProtocolRes.java index ae72696..97e96d7 100644 --- a/RISE-V2G-EVCC/src/main/java/org/v2gclarity/risev2g/evcc/states/WaitForSupportedAppProtocolRes.java +++ b/RISE-V2G-EVCC/src/main/java/org/v2gclarity/risev2g/evcc/states/WaitForSupportedAppProtocolRes.java @@ -99,8 +99,9 @@ public class WaitForSupportedAppProtocolRes extends ClientState { TimeRestrictions.V2G_EVCC_COMMUNICATION_SETUP_TIMEOUT - elapsedTimeInMs )); } else { - return new TerminateSession("Invalid message (" + message.getClass().getSimpleName() + - ") at this state (" + this.getClass().getSimpleName() + ")"); + String className = (message != null) ? message.getClass().getSimpleName() : ""; + + return new TerminateSession("Invalid message (" + className + ") at this state (" + this.getClass().getSimpleName() + ")"); } } }