Only send message if generalChannel is available
Ensure generalChannel is available before attempting to send a message
This commit is contained in:
committed by
GitHub
parent
a74841e9ec
commit
8804492089
@@ -98,7 +98,7 @@ $(function() {
|
||||
// Send a new message to the general channel
|
||||
var $input = $('#chat-input');
|
||||
$input.on('keydown', function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
if (e.keyCode == 13 && generalChannel) {
|
||||
generalChannel.sendMessage($input.val())
|
||||
$input.val('');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user