--- a/src/main/java/de/uapcore/lightpit/Functions.java Thu Oct 15 18:36:05 2020 +0200 +++ b/src/main/java/de/uapcore/lightpit/Functions.java Thu Oct 15 20:02:30 2020 +0200 @@ -74,6 +74,14 @@ return req.getServletPath() + Optional.ofNullable(req.getPathInfo()).orElse(""); } + public static int parseIntOrZero(String str) { + try { + return Integer.parseInt(str); + } catch (NumberFormatException ex) { + return 0; + } + } + /** * This class is not instantiatable. */