Check against null values

This commit is contained in:
Xavi Aracil 2022-12-20 13:07:45 +01:00
parent 1677a0b359
commit 810bb023bc

View File

@ -26,7 +26,7 @@ public class ExpirationProbe extends Probe<Credential> {
* and the expiration date is prior to the current date, the credential has expired. * and the expiration date is prior to the current date, the credential has expired.
*/ */
JsonNode node = crd.getJson().get(crd.getExpiresAtPropertyName()); JsonNode node = crd.getJson().get(crd.getExpiresAtPropertyName());
if(node != null) { if(node != null && !node.isNull()) {
try { try {
ZonedDateTime expirationDate = ZonedDateTime.parse(node.textValue()); ZonedDateTime expirationDate = ZonedDateTime.parse(node.textValue());
if (ZonedDateTime.now().isAfter(expirationDate)) { if (ZonedDateTime.now().isAfter(expirationDate)) {