diff options
author | Thomas <> | 2022-07-01 17:10:52 +0200 |
---|---|---|
committer | Thomas <> | 2022-07-01 17:10:52 +0200 |
commit | 99351e33f4e3e47bb2496c9c656d671079876742 (patch) | |
tree | 47340ab696be9744a5bf55b2f7edf5aed9fdada2 | |
parent | e3afbc7442ad3893e7615d50747c03f600eb1a1b (diff) | |
download | National_eIDAS_Gateway-99351e33f4e3e47bb2496c9c656d671079876742.tar.gz National_eIDAS_Gateway-99351e33f4e3e47bb2496c9c656d671079876742.tar.bz2 National_eIDAS_Gateway-99351e33f4e3e47bb2496c9c656d671079876742.zip |
refact(matching): make address-search sort result more resistent
-rw-r--r-- | modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/controller/AdresssucheController.java | 19 |
1 files changed, 12 insertions, 7 deletions
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; + } }; } |