From ce5cf71b1a412181e54f8f5433523fa7c7b04e7b Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Tue, 25 Jun 2024 16:48:39 +0200 Subject: [PATCH] Use null-safe comparison in AuthenticationExecutionExportRepresentationComparator This avoids an InvalidImportException when parsing authenticationExecutions without priority. Fixes #1071 Signed-off-by: Thomas Darimont --- .../keycloak/config/model/AuthenticationFlowImport.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/adorsys/keycloak/config/model/AuthenticationFlowImport.java b/src/main/java/de/adorsys/keycloak/config/model/AuthenticationFlowImport.java index 65374b163..01c046ced 100644 --- a/src/main/java/de/adorsys/keycloak/config/model/AuthenticationFlowImport.java +++ b/src/main/java/de/adorsys/keycloak/config/model/AuthenticationFlowImport.java @@ -20,6 +20,7 @@ package de.adorsys.keycloak.config.model; +import org.apache.commons.lang3.ObjectUtils; import org.keycloak.representations.idm.AuthenticationExecutionExportRepresentation; import org.keycloak.representations.idm.AuthenticationFlowRepresentation; import org.springframework.stereotype.Component; @@ -55,7 +56,7 @@ public int compare( AuthenticationExecutionExportRepresentation first, AuthenticationExecutionExportRepresentation second ) { - return first.getPriority() - second.getPriority(); + return ObjectUtils.compare(first.getPriority(), second.getPriority()); } } }