From b46282439c2d60cf0fce7097e7c39df6d554cd9d Mon Sep 17 00:00:00 2001 From: Vladislav Selitskii Date: Wed, 11 Aug 2021 17:09:50 +0400 Subject: [PATCH] Fix SpotBugs --- .../src/com/haulmont/addon/imap/sync/events/ImapEvents.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core/src/com/haulmont/addon/imap/sync/events/ImapEvents.java b/modules/core/src/com/haulmont/addon/imap/sync/events/ImapEvents.java index 594edfc..f85ea8f 100644 --- a/modules/core/src/com/haulmont/addon/imap/sync/events/ImapEvents.java +++ b/modules/core/src/com/haulmont/addon/imap/sync/events/ImapEvents.java @@ -140,11 +140,11 @@ private void invokeAttachedHandlers(BaseImapEvent event, ImapFolder cubaFolder, log.trace("{}: invoking handlers {} for event {}", cubaFolder.getName(), handlers, event); for (ImapEventHandler handler : handlers) { - Object bean = AppBeans.get(handler.getBeanName()); - if (bean == null) { + if (!AppBeans.containsBean(handler.getBeanName())) { log.warn("No bean {} is available, check the folder {} configuration", handler.getBeanName(), cubaFolder); return; } + Object bean = AppBeans.get(handler.getBeanName()); Class eventClass = event.getClass(); try { authentication.begin();