Skip to content

Commit

Permalink
Fix right clicking a group and choosing "remove selected entries from…
Browse files Browse the repository at this point in the history
… this group" leads to error when Bibtex source tab is selected (#8821)

* Fix #8012 by adding validation before setting value to field that object does not have

* Update CHANGELOG.md
  • Loading branch information
LIM0000 authored May 22, 2022
1 parent c0d8b0f commit 7257350
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where deprecated fields tab is shown when the fields don't contain any values. [#8396](https://github.com/JabRef/jabref/issues/8396)
- We fixed an issue which allow us to select and open identifiers from a popup list in the maintable [#8758](https://github.com/JabRef/jabref/issues/8758), [8802](https://github.com/JabRef/jabref/issues/8802)
- We fixed an issue where the escape button had no functionality within the "Filter groups" textfield. [koppor#562](https://github.com/koppor/jabref/issues/562)
- We fixed an issue where right clicking a group and choose "remove selected entries from this group" leads to error when Bibtex source tab is selected. [#8012](https://github.com/JabRef/jabref/issues/8012)

### Removed

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/jabref/gui/entryeditor/SourceTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,9 @@ private void storeSource(BibEntry outOfFocusEntry, String text) {
new FieldWriter(fieldWriterPreferences).write(fieldName, newValue);

compound.addEdit(new UndoableFieldChange(outOfFocusEntry, fieldName, oldValue, newValue));
outOfFocusEntry.setField(fieldName, newValue);
if (outOfFocusEntry.getField(fieldName).isPresent()) {
outOfFocusEntry.setField(fieldName, newValue);
}
}
}

Expand Down

0 comments on commit 7257350

Please sign in to comment.