From ee22456c76b79a08ce6a4fbc801f5d9bbe67eab0 Mon Sep 17 00:00:00 2001 From: Lubos Racansky Date: Thu, 19 Oct 2023 15:02:27 +0200 Subject: [PATCH] Fix #455: PowerAuthClientException#getPowerAuthError is nullable --- pom.xml | 3 ++- .../powerauth/rest/api/spring/service/ActivationService.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 24807c6e..e3c8f5c4 100644 --- a/pom.xml +++ b/pom.xml @@ -86,8 +86,9 @@ 3.1.3 1.10.0 1.76 + 1.7.0 - 1.5.0 + 1.6.0-SNAPSHOT 1.5.1 diff --git a/powerauth-restful-security-spring/src/main/java/io/getlime/security/powerauth/rest/api/spring/service/ActivationService.java b/powerauth-restful-security-spring/src/main/java/io/getlime/security/powerauth/rest/api/spring/service/ActivationService.java index 1d2b9cf0..f5a2a95c 100644 --- a/powerauth-restful-security-spring/src/main/java/io/getlime/security/powerauth/rest/api/spring/service/ActivationService.java +++ b/powerauth-restful-security-spring/src/main/java/io/getlime/security/powerauth/rest/api/spring/service/ActivationService.java @@ -469,7 +469,7 @@ public ActivationLayer1Response createActivation(ActivationLayer1Request request } } } catch (PowerAuthClientException ex) { - if (ex.getPowerAuthError() instanceof final PowerAuthErrorRecovery errorRecovery) { + if (ex.getPowerAuthError().orElse(null) instanceof final PowerAuthErrorRecovery errorRecovery) { logger.debug("Invalid recovery code, current PUK index: {}", errorRecovery.getCurrentRecoveryPukIndex()); throw new PowerAuthRecoveryException(ex.getMessage(), "INVALID_RECOVERY_CODE", errorRecovery.getCurrentRecoveryPukIndex()); }