From 93a1c0f0892b32fde350ebcd7b064b641e8b4cb5 Mon Sep 17 00:00:00 2001 From: Siedlerchr Date: Thu, 9 Nov 2023 22:45:44 +0100 Subject: [PATCH] Fix NPE in lookup identifer Fixes #10629 --- .../jabref/gui/fieldeditors/identifier/IdentifierEditor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java b/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java index 7afd5d23fde..567f6c45047 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java @@ -46,7 +46,7 @@ public class IdentifierEditor extends HBox implements FieldEditorFX { @Inject private UndoManager undoManager; @Inject private StateManager stateManager; - private Optional entry; + private Optional entry = Optional.empty(); public IdentifierEditor(Field field, SuggestionProvider suggestionProvider, @@ -96,6 +96,7 @@ public BaseIdentifierEditorViewModel getViewModel() { @Override public void bindToEntry(BibEntry entry) { + this.entry = Optional.of(entry); viewModel.bindToEntry(entry); }