Skip to content

Commit 976d32f

Browse files
committed
SimpleApplicationEventMulticaster defensively swallows ClassCastException without message
Issue: SPR-15145
1 parent e5f4cb6 commit 976d32f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ protected void invokeListener(ApplicationListener listener, ApplicationEvent eve
168168
}
169169
catch (ClassCastException ex) {
170170
String msg = ex.getMessage();
171-
if (msg != null && msg.startsWith(event.getClass().getName())) {
171+
if (msg == null || msg.startsWith(event.getClass().getName())) {
172172
// Possibly a lambda-defined listener which we could not resolve the generic event type for
173173
Log logger = LogFactory.getLog(getClass());
174174
if (logger.isDebugEnabled()) {

0 commit comments

Comments
 (0)