From 258e4b90859dc8daff12457d25ba09892d3c37ff Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Fri, 30 Dec 2016 11:00:16 -0600 Subject: [PATCH] fix setting avatar to buffer (#1048) --- src/structures/ClientUser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structures/ClientUser.js b/src/structures/ClientUser.js index 35ec22bde..6a8532141 100644 --- a/src/structures/ClientUser.js +++ b/src/structures/ClientUser.js @@ -116,7 +116,7 @@ class ClientUser extends User { * .catch(console.error); */ setAvatar(avatar) { - if (avatar.startsWith('data:')) { + if (typeof avatar === 'string' && avatar.startsWith('data:')) { return this.client.rest.methods.updateCurrentUser({ avatar }); } else { return this.client.resolver.resolveBuffer(avatar).then(data =>