aboutsummaryrefslogtreecommitdiff
path: root/webAO
diff options
context:
space:
mode:
authorcaleb.mabry.15@cnu.edu <caleb.mabry.15@cnu.edu>2022-03-22 00:16:52 -0400
committercaleb.mabry.15@cnu.edu <caleb.mabry.15@cnu.edu>2022-03-22 00:16:52 -0400
commit4d09a4a7105de76189fae41e86c9186ba7ff76fd (patch)
tree933aa0e8e578aeec483f10811e0dbf7a5e25e7b7 /webAO
parenta5d85f1e7cdbf144e2793da3bb5183eff9c6a7bc (diff)
ez error handling
Diffstat (limited to 'webAO')
-rw-r--r--webAO/client.js5
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;