Ver Fonte

Fix typo that results in a null pointer

The old implementation uses a bitwise comparison 
that will validate both statements and will result
in a null pointer. The fix will do a
 logic comparison that will return if the first 
statement is null
Jesse Kerkhoven há 6 anos atrás
pai
commit
dbd0fe8da3

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

@@ -56,7 +56,7 @@ public class WaitForChargingStatusRes extends ClientState {
 			 * a MeteringReceiptRequest. If no TLS is used, a MeteringReceiptRequest may not be sent because
 			 * a signature cannot be applied without private key of the contract certificate.
 			 */
-			if (chargingStatusRes.isReceiptRequired() != null & chargingStatusRes.isReceiptRequired() && getCommSessionContext().isTlsConnection()) {
+			if (chargingStatusRes.isReceiptRequired() != null && chargingStatusRes.isReceiptRequired() && getCommSessionContext().isTlsConnection()) {
 				MeteringReceiptReqType meteringReceiptReq = new MeteringReceiptReqType();
 				/*
 				 * Experience from the test symposium in San Diego (April 2016):