diff --git a/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java b/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java index dc8d533338d..b4372d4cba5 100644 --- a/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java +++ b/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java @@ -88,24 +88,24 @@ public void importEntries(List entriesToImport) { if (!continueImport) { dialogService.notify(Localization.lang("Import canceled")); + } else { + ImportHandler importHandler = new ImportHandler( + dialogService, + database, + ExternalFileTypes.getInstance(), + preferences.getFilePreferences(), + preferences.getImportFormatPreferences(), + preferences.getUpdateFieldPreferences(), + fileUpdateMonitor, + undoManager, + stateManager); + importHandler.importEntries(entriesToImport); + dialogService.notify(Localization.lang("Number of entries successfully imported") + ": " + entriesToImport.size()); } } }).executeWith(Globals.TASK_EXECUTOR); } - ImportHandler importHandler = new ImportHandler( - dialogService, - database, - ExternalFileTypes.getInstance(), - preferences.getFilePreferences(), - preferences.getImportFormatPreferences(), - preferences.getUpdateFieldPreferences(), - fileUpdateMonitor, - undoManager, - stateManager); - importHandler.importEntries(entriesToImport); - - dialogService.notify(Localization.lang("Number of entries successfully imported") + ": " + entriesToImport.size()); } /**