keep the original url if the decoder fails for any reason

This commit is contained in:
Alessia Bardi 2021-08-25 10:07:58 +02:00
parent 45898c71ac
commit ccf4103a25
2 changed files with 2 additions and 2 deletions

View File

@ -169,7 +169,7 @@ public class OafToOafMapper extends AbstractMdRecordToOafMapper {
.map(s -> {
try {
return URLDecoder.decode(s, "UTF-8");
} catch (UnsupportedEncodingException e) {
} catch (Throwable t) {
return s;
}
})

View File

@ -168,7 +168,7 @@ public class OdfToOafMapper extends AbstractMdRecordToOafMapper {
protected String trimAndDecodeUrl(String url) {
try {
return URLDecoder.decode(url.trim(), "UTF-8");
} catch (UnsupportedEncodingException e) {
} catch (Throwable t) {
return url;
}
}