Skip to content

Commit

Permalink
Merge pull request #202 from reckart/bugfix/201-WebSocketMessageSende…
Browse files Browse the repository at this point in the history
…rDefault.sendTo()-fails-when-no-Wicket-application-is-bound-to-the-current-thread

Issue #201 - WebSocketMessageSenderDefault.sendTo() fails when no Wicket application is bound to the current thread
  • Loading branch information
MarcGiffing authored Mar 22, 2024
2 parents bed77c6 + a705bda commit 6455b44
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ public void sendToAll(IWebSocketPushMessage event) {
}
}

public void sendTo(Object identifier, IWebSocketPushMessage event) {
@Override
public void sendTo(Object identifier, IWebSocketPushMessage event) {
if(identifier == null) {
return;
}
Application application = Application.get();

WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application);
IWebSocketConnectionRegistry connectionRegistry = webSocketSettings.getConnectionRegistry();
wicketSessionResolver.resolve(identifier).forEach(sessionId -> {
Expand All @@ -49,5 +50,4 @@ public void sendTo(Object identifier, IWebSocketPushMessage event) {
}
});
}

}

0 comments on commit 6455b44

Please sign in to comment.