From 99351e33f4e3e47bb2496c9c656d671079876742 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Fri, 1 Jul 2022 17:10:52 +0200 Subject: refact(matching): make address-search sort result more resistent --- .../eidas/v2/controller/AdresssucheController.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'modules/authmodule-eIDAS-v2') diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/controller/AdresssucheController.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/controller/AdresssucheController.java index 6faa35fd..a08128d3 100644 --- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/controller/AdresssucheController.java +++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/controller/AdresssucheController.java @@ -230,13 +230,18 @@ public class AdresssucheController { int extractInt(String s) { if (StringUtils.isNotEmpty(s)) { final String num = s.replaceAll("\\D", ""); - // return 0 if no digits found - return num.isEmpty() ? 0 : Integer.parseInt(num); - - } else { - return 0; - - } + try { + // return 0 if no digits found + return num.isEmpty() ? 0 : Integer.parseInt(num); + + } catch (Exception e) { + log.info("Can not parse number from ZMR", e); + + } + } + + return 0; + } }; } -- cgit v1.2.3