Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1657 from Naktibalda/patch-6
Browse files Browse the repository at this point in the history
fix: WebAdapter only sends message if websocket is OPEN
  • Loading branch information
benbrown authored May 14, 2019
2 parents 079d82c + ed22aae commit 9d8a370
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/botbuilder-adapter-web/src/web_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class WebAdapter extends BotAdapter {
if (channel === 'websocket') {
// If this turn originated with a websocket message, respond via websocket
var ws = clients[activity.recipient.id];
if (ws) {
if (ws && ws.readyState === 1) {
try {
ws.send(JSON.stringify(message));
} catch (err) {
Expand Down

0 comments on commit 9d8a370

Please sign in to comment.