Skip to content

Commit

Permalink
Catch numberformatexception and newline
Browse files Browse the repository at this point in the history
  • Loading branch information
markusweigelt committed Feb 22, 2024
1 parent bc1ac23 commit 89f8afb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
1 change: 0 additions & 1 deletion Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css
Original file line number Diff line number Diff line change
Expand Up @@ -3192,7 +3192,6 @@ Column content
color: white;
}


#imagePreviewForm\:mediaDetailMediaPartialsContainer {
position: relative;
flex: 0 0 auto;
Expand Down

0 comments on commit 89f8afb

Please sign in to comment.