Skip to content

Commit

Permalink
fix: sioobe
Browse files Browse the repository at this point in the history
  • Loading branch information
cleydyr committed Aug 8, 2023
1 parent 183eac3 commit 413ea43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/biblivre/marc/MarcDataReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ private String formatDataField(String format, List<DataField> dataFieldList) {
}
case "(" -> shouldAddStartParenthesis = true;
case ")" -> {
if (result.charAt(result.length()) == CharPool.OPEN_PARENTHESIS) {
if (result.charAt(result.length() - 1) == CharPool.OPEN_PARENTHESIS) {
result.deleteCharAt(result.length() - 1);
} else if (!shouldAddStartParenthesis) {
result.append(CharPool.CLOSE_PARENTHESIS);
Expand Down

0 comments on commit 413ea43

Please sign in to comment.