Updated message class

Will now crash less when handling masses of data from hundreds of
server, as sometimes when a server is destroyed the message still
believes it exists
This commit is contained in:
hydrabolt
2015-10-30 13:52:53 +00:00
parent 9aff24201f
commit 0b2778c114

View File

@@ -23,7 +23,7 @@ class Message {
if (this.isPrivate) {
this.author = this.channel.client.getUser("id", author.id);
} else {
this.author = this.channel.server.getMember("id", author.id) || this.channel.client.getUser("id", author.id);
this.author = this.channel.server ? this.channel.server.getMember("id", author.id) : this.channel.client.getUser("id", author.id);
}
this.attachments = data.attachments;