Skip to content

Commit f425a99

Browse files
committed
Ignore missing STOMP decoder if session closed
Closes gh-24842
1 parent 57f1e86 commit f425a99

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spring-websocket/src/main/java/org/springframework/web/socket/messaging/StompSubProtocolHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -240,6 +240,10 @@ else if (webSocketMessage instanceof BinaryMessage) {
240240

241241
BufferingStompDecoder decoder = this.decoders.get(session.getId());
242242
if (decoder == null) {
243+
if (!session.isOpen()) {
244+
logger.trace("Dropped inbound WebSocket message due to closed session");
245+
return;
246+
}
243247
throw new IllegalStateException("No decoder for session id '" + session.getId() + "'");
244248
}
245249

0 commit comments

Comments
 (0)