Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master:
  Fix NPE in Duplicate Resolver Dialog (#4791)
  • Loading branch information
Siedlerchr committed Mar 25, 2019
2 parents 48ed0ba + 6c61664 commit c20c28a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/DuplicateResolverDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public enum DuplicateResolverResult {

public DuplicateResolverDialog(BibEntry one, BibEntry two, DuplicateResolverType type, BibDatabaseContext database) {
this.setTitle(Localization.lang("Possible duplicate entries"));
init(one, two, type);
this.database = database;
init(one, two, type);
}

private void init(BibEntry one, BibEntry two, DuplicateResolverType type) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/PreviewPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public class PreviewPanel extends ScrollPane implements SearchQueryHighlightList

/**
* @param panel (may be null) Only set this if the preview is associated to the main window.
* @param databaseContext Used for resolving pdf directories for links. Must not be null.
* @param databaseContext Used for resolving pdf directories for links. Must not be null, just pass a new empty BibDatabaseContext()
*/
public PreviewPanel(BasePanel panel, BibDatabaseContext databaseContext, KeyBindingRepository keyBindingRepository, PreviewPreferences preferences, DialogService dialogService, ExternalFileTypes externalFileTypes) {
this.databaseContext = Objects.requireNonNull(databaseContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void makeChange(BibDatabaseContext database, NamedCompound undoEdit) {

@Override
public Node description() {
PreviewPanel previewPanel = new PreviewPanel(null, null, Globals.getKeyPrefs(), Globals.prefs.getPreviewPreferences(), new FXDialogService(), ExternalFileTypes.getInstance());
PreviewPanel previewPanel = new PreviewPanel(null, new BibDatabaseContext(), Globals.getKeyPrefs(), Globals.prefs.getPreviewPreferences(), new FXDialogService(), ExternalFileTypes.getInstance());
previewPanel.setEntry(diskEntry);
return previewPanel;
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jabref/gui/search/SearchResultFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.jabref.logic.bibtex.comparator.FieldComparator;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.search.SearchQuery;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.FieldName;
import org.jabref.model.entry.FieldProperty;
Expand Down Expand Up @@ -122,7 +123,7 @@ private void init(String title) {
searchResultFrame.setTitle(title);
searchResultFrame.setIconImages(IconTheme.getLogoSet());

preview = new PreviewPanel(null, null, Globals.getKeyPrefs(), Globals.prefs.getPreviewPreferences(), frame.getDialogService(), ExternalFileTypes.getInstance());
preview = new PreviewPanel(null, new BibDatabaseContext(), Globals.getKeyPrefs(), Globals.prefs.getPreviewPreferences(), frame.getDialogService(), ExternalFileTypes.getInstance());

sortedEntries = new SortedList<>(entries, new EntryComparator(false, true, FieldName.AUTHOR));
model = (DefaultEventTableModel<BibEntry>) GlazedListsSwing.eventTableModelWithThreadProxyList(sortedEntries,
Expand Down

0 comments on commit c20c28a

Please sign in to comment.