From e85193eac58fc37ae077c305c1b11d65febb3f0c Mon Sep 17 00:00:00 2001 From: Matthew R Date: Mon, 16 Nov 2020 12:10:17 -0500 Subject: [PATCH] history empty arr fix --- src/commands/score_hist.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/score_hist.ts b/src/commands/score_hist.ts index 8664992..7940cc4 100644 --- a/src/commands/score_hist.ts +++ b/src/commands/score_hist.ts @@ -26,7 +26,8 @@ export default class Score_Hist extends Command { user = message.author; if (!user) return this.error(message.channel, 'Member not found.'); const hists = await this.client.db.ScoreHistorical.find({ userID: user.id }).lean().exec(); - if (!hists || hists?.length <= 0) return this.error(message.channel, 'No history found.'); + if (!hists) return this.error(message.channel, 'No history found.'); + if (hists.length < 1) return this.error(message.channel, 'No history found.'); const histArray: [{ name: string, value: string }?] = []; const totalArray: number[] = []; const activityArray: number[] = [];