From 2e63c0f305911b2984fbb84984b60de670db43a6 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Wed, 23 Sep 2020 21:22:55 +0200 Subject: [PATCH] Error handling when attempting chat on closed connection. --- static/sfu.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/sfu.js b/static/sfu.js index 767d294..33ec084 100644 --- a/static/sfu.js +++ b/static/sfu.js @@ -1437,6 +1437,11 @@ function handleInput() { me = false; } + if(!serverConnection || !serverConnection.socket) { + displayError("Not connected."); + return; + } + let username = getUsername(); if(!username) { displayError("Sorry, you're anonymous, you cannot chat");