diff options
| author | caleb.mabry.15@cnu.edu <caleb.mabry.15@cnu.edu> | 2022-03-22 00:16:52 -0400 |
|---|---|---|
| committer | caleb.mabry.15@cnu.edu <caleb.mabry.15@cnu.edu> | 2022-03-22 00:16:52 -0400 |
| commit | 4d09a4a7105de76189fae41e86c9186ba7ff76fd (patch) | |
| tree | 933aa0e8e578aeec483f10811e0dbf7a5e25e7b7 /webAO | |
| parent | a5d85f1e7cdbf144e2793da3bb5183eff9c6a7bc (diff) | |
ez error handling
Diffstat (limited to 'webAO')
| -rw-r--r-- | webAO/client.js | 5 |
1 files changed, 4 insertions, 1 deletions
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; |
