소스 검색

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