From 89f8afbfdd135fb14b15c8f4333443ce51d9a917 Mon Sep 17 00:00:00 2001 From: Markus Weigelt Date: Thu, 22 Feb 2024 19:02:45 +0100 Subject: [PATCH] Catch numberformatexception and newline --- .../helper/metadata/MediaPartialHelper.java | 11 +++++------ .../src/main/webapp/WEB-INF/resources/css/kitodo.css | 1 - 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Kitodo/src/main/java/org/kitodo/production/helper/metadata/MediaPartialHelper.java b/Kitodo/src/main/java/org/kitodo/production/helper/metadata/MediaPartialHelper.java index 7dcc967029b..5f0fc071602 100644 --- a/Kitodo/src/main/java/org/kitodo/production/helper/metadata/MediaPartialHelper.java +++ b/Kitodo/src/main/java/org/kitodo/production/helper/metadata/MediaPartialHelper.java @@ -68,15 +68,14 @@ public static String convertTimeToFormattedTime(String time) { Date date; try { date = DateUtils.parseDate(separatedMilliseconds[0], "HH:mm:ss", "mm:ss", "ss"); - } catch (ParseException e) { + if (separatedMilliseconds.length == 2) { + String filledMilliseconds = StringUtils.rightPad(separatedMilliseconds[1], 3, "0"); + date = new Date(date.getTime() + Integer.parseInt(filledMilliseconds)); + } + } catch (ParseException | NumberFormatException e) { return time; } - if (separatedMilliseconds.length == 2) { - String filledMilliseconds = StringUtils.rightPad(separatedMilliseconds[1], 3, "0"); - date = new Date(date.getTime() + Integer.parseInt(filledMilliseconds)); - } - return new SimpleDateFormat("HH:mm:ss.SSS").format(date); } diff --git a/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css b/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css index dc4b5607485..f0cf776b90d 100644 --- a/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css +++ b/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css @@ -3192,7 +3192,6 @@ Column content color: white; } - #imagePreviewForm\:mediaDetailMediaPartialsContainer { position: relative; flex: 0 0 auto;