some null checks to prevent errors

This commit is contained in:
Cynthia Foxwell 2022-10-19 20:23:33 -06:00
parent 9199002e12
commit c2675fefa3
2 changed files with 2 additions and 2 deletions

View file

@ -204,7 +204,7 @@ client.on("messageUpdate", async function (msg, old) {
comcord.state.currentChannel ||
msg.channel?.recipient != null
) {
if (msg.content == old.content) return;
if (old && msg.content == old.content) return;
if (comcord.state.inPrompt) {
comcord.state.messageQueue.push(msg);

View file

@ -327,7 +327,7 @@ function processMessage(msg, options = {}) {
if (msg.time) {
console.log(msg.content);
} else if (msg.content.indexOf("\n") > -1) {
} else if (msg.content && msg.content.indexOf("\n") > -1) {
if (msg.content.match(REGEX_CODEBLOCK)) {
formatMessage({
name: msg.author.username,