Skip to content

Commit

Permalink
Fix JabRef#8012 by adding validation before setting value to field th…
Browse files Browse the repository at this point in the history
…at object does not have
  • Loading branch information
LIM0000 committed May 18, 2022
1 parent 82aad89 commit 98f6c65
Showing 1 changed file with 3 additions and 1 deletion.
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 98f6c65

Please sign in to comment.