mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-04-14 23:50:33 +03:00
Fix a crash in renderer when a channel has no messages
This commit is contained in:
parent
5bca25d019
commit
170c61b3bd
@ -35,7 +35,7 @@ SAVEFILE.prototype.getUserById = function(user){
|
||||
};
|
||||
|
||||
SAVEFILE.prototype.getMessageCount = function(channel){
|
||||
return Object.keys(this.data[channel]).length || 0;
|
||||
return Object.keys(this.getMessages(channel)).length;
|
||||
};
|
||||
|
||||
SAVEFILE.prototype.getAllMessages = function(){
|
||||
@ -49,5 +49,5 @@ SAVEFILE.prototype.getAllMessages = function(){
|
||||
};
|
||||
|
||||
SAVEFILE.prototype.getMessages = function(channel){
|
||||
return this.data[channel] || [];
|
||||
return this.data[channel] || {};
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user