Skip to content

Commit

Permalink
Fix exception on preview style edit and selection (#8293)
Browse files Browse the repository at this point in the history
Fixes #8280
  • Loading branch information
Siedlerchr authored Dec 3, 2021
1 parent eff62f6 commit f7df275
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve

### Fixed

- We fixed an issue where an exception occured when a preview style was edited and afterwards another preview style selected. [#8280](https://github.com/JabRef/jabref/issues/8280)
- We fixed an issue where the actions to move a file to a directory were incorrectly disabled. [#7908](https://github.com/JabRef/jabref/issues/7908)
- We fixed an issue where an exception occurred when a linked online file was edited in the entry editor [#8008](https://github.com/JabRef/jabref/issues/8008)
- We fixed an issue when checking for a new version when JabRef is used behind a corporate proxy. [#7884](https://github.com/JabRef/jabref/issues/7884)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ public void setPreviewLayout(PreviewLayout selectedLayout) {
}

public void refreshPreview() {
layoutProperty.setValue(null);
setPreviewLayout(chosenSelectionModelProperty.getValue().getSelectedItem());
}

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/jabref/gui/preview/PreviewViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ private static String createJavaScriptRegex(Pattern regex) {
}

public void setLayout(PreviewLayout newLayout) {
// Change listeners might set the layout to null while the update method is executing, therefore we need to prevent this here
if (newLayout == null) {
return;
}
layout = newLayout;
update();
}
Expand Down

0 comments on commit f7df275

Please sign in to comment.