Fix error when calling resolveUserId with null/missing user id

This commit is contained in:
Miikka Virtanen 2019-08-14 10:55:34 +03:00
parent 328ec379c5
commit a48a58bd3c

View file

@ -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) {