From 4d09a4a7105de76189fae41e86c9186ba7ff76fd Mon Sep 17 00:00:00 2001 From: "caleb.mabry.15@cnu.edu" Date: Tue, 22 Mar 2022 00:16:52 -0400 Subject: ez error handling --- webAO/client.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 87db272..44cc8bd 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -2244,7 +2244,10 @@ class Viewport { this.currentBlipChannel %= this.blipChannels.length; } this.textnow = this.chatmsg.content.substring(0, this.textnow.length + 1); - chatBoxInner.appendChild(this.chatmsg.parsed[this.textnow.length - 1]); + const characterElement = this.chatmsg.parsed[this.textnow.length - 1] + if (characterElement) { + chatBoxInner.appendChild(this.chatmsg.parsed[this.textnow.length - 1]); + } // scroll to bottom chatBox.scrollTop = chatBox.scrollHeight; -- cgit