diff --git a/src/main/java/org/jabref/gui/util/BackgroundTask.java b/src/main/java/org/jabref/gui/util/BackgroundTask.java index a6db2797cf1..2b9e7b65d2a 100644 --- a/src/main/java/org/jabref/gui/util/BackgroundTask.java +++ b/src/main/java/org/jabref/gui/util/BackgroundTask.java @@ -257,8 +257,11 @@ public BackgroundTask withInitialMessage(String message) { return this; } - public static Node getIcon(Task task) { - return BackgroundTask.iconMap.getOrDefault(task).getTitle(), null); + public static Node getIcon(Object task) { + if (task instanceof Task) { + return BackgroundTask.iconMap.getOrDefault(((Task) task).getTitle(), null); + } + return null; } static class BackgroundProgress {