From a48a58bd3cac42e0a327c5c1c60db21682785097 Mon Sep 17 00:00:00 2001 From: Miikka Virtanen <2606411+Dragory@users.noreply.github.com> Date: Wed, 14 Aug 2019 10:55:34 +0300 Subject: [PATCH] Fix error when calling resolveUserId with null/missing user id --- src/utils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils.ts b/src/utils.ts index 1cfdfe8b..643322c1 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -622,6 +622,10 @@ const unknownUsers = new Set(); const unknownMembers = new Set(); export function resolveUserId(bot: Client, value: string) { + if (value == null) { + return null; + } + // A user mention? const mentionMatch = value.match(/^<@!?(\d+)>$/); if (mentionMatch) {