From 0a005cbd1665e7c37b40f3626207fa0e5824e7bf Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Thu, 25 Aug 2016 19:14:19 -0400 Subject: [PATCH] Fix other .equals(null) (#541) --- src/structures/GroupDMChannel.js | 1 + src/structures/Guild.js | 1 + src/structures/GuildChannel.js | 1 + src/structures/Role.js | 1 + 4 files changed, 4 insertions(+) diff --git a/src/structures/GroupDMChannel.js b/src/structures/GroupDMChannel.js index 4db62ee81..231ac406b 100644 --- a/src/structures/GroupDMChannel.js +++ b/src/structures/GroupDMChannel.js @@ -55,6 +55,7 @@ class GroupDMChannel extends Channel { equals(other) { const base = ( + other && this.id === other.id && this.name === other.name && this.icon === other.icon && diff --git a/src/structures/Guild.js b/src/structures/Guild.js index 4d4c98faa..13409fa16 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -166,6 +166,7 @@ class Guild { */ equals(data) { let base = + data && this.id === data.id && this.available === !data.unavailable && this.splash === data.splash && diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index 987a0c0b7..90a08cbf7 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -67,6 +67,7 @@ class GuildChannel extends Channel { */ equals(other) { let base = ( + other && this.type === other.type && this.topic === other.topic && this.position === other.position && diff --git a/src/structures/Role.js b/src/structures/Role.js index b244ab8bf..a968c567f 100644 --- a/src/structures/Role.js +++ b/src/structures/Role.js @@ -22,6 +22,7 @@ class Role { equals(role) { return ( + role && this.id === role.id && this.name === role.name && this.color === role.color &&