Преглед на файлове

The field 'ReceiptRequired' in the CurrentDemandRes message is optional. Fixed the code in EVCC's class WaitForCurrentDemandRes.java so that it does not necessarily expect the field 'ReceiptRequired' to be set (otherwise a NullPointerException would be thrown).

Marc Mültin преди 7 години
родител
ревизия
a74e0ad073
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      RISE-V2G-EVCC/src/main/java/com/v2gclarity/risev2g/evcc/states/WaitForCurrentDemandRes.java

+ 1 - 1
RISE-V2G-EVCC/src/main/java/com/v2gclarity/risev2g/evcc/states/WaitForCurrentDemandRes.java

@@ -50,7 +50,7 @@ public class WaitForCurrentDemandRes extends ClientState {
 					(CurrentDemandResType) v2gMessageRes.getBody().getBodyElement().getValue();
 			
 			// ReceiptRequired has higher priority than a possible EVSENotification=Renegotiate
-			if (currentDemandRes.isReceiptRequired()) {
+			if (currentDemandRes.isReceiptRequired() != null && currentDemandRes.isReceiptRequired()) {
 				MeteringReceiptReqType meteringReceiptReq = new MeteringReceiptReqType();
 				/*
 				 * Experience from the test symposium in San Diego (April 2016):