瀏覽代碼

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
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):