Skip to content

Commit

Permalink
Fix for issue JabRef#7526, catches the StringIndexOutOfBoundsExceptio…
Browse files Browse the repository at this point in the history
…n before it is shown to the user.
  • Loading branch information
brapana committed May 18, 2021
1 parent 65a672a commit 61e19ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/logic/layout/LayoutHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ private void parse() throws IOException, StringIndexOutOfBoundsException {
}
}

private void parseField() throws IOException {
private void parseField() throws IOException, StringIndexOutOfBoundsException {
int c;
StringBuilder buffer = null;
String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public void setText(String text) {
StringReader sr = new StringReader(text.replace("__NEWLINE__", "\n"));
try {
layout = new LayoutHelper(sr, layoutFormatterPreferences).getLayoutFromText();
} catch (StringIndexOutOfBoundsException e) {
LOGGER.error("Could not generate layout", e);
} catch (IOException e) {
LOGGER.error("Could not generate layout", e);
}
Expand Down

0 comments on commit 61e19ba

Please sign in to comment.