From bac8ed4c7cbf22c969ea6c46eeb6d8065de8f5a5 Mon Sep 17 00:00:00 2001 From: Bsian Date: Tue, 29 Oct 2019 19:43:53 +0000 Subject: [PATCH] Fixed CPU leak --- src/class/Util.ts | 2 +- src/commands/modlogs.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/class/Util.ts b/src/class/Util.ts index a59d1a8..b02284a 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -92,7 +92,7 @@ export default class Util { let str: string = ''; let pos: number; while (string.length > 0) { - pos = string.length > length ? string.lastIndexOf('\n', length) : outputFile.length; + pos = string.length > length ? string.lastIndexOf('\n', length) : string.length; if (pos > length) pos = length; str = string.substr(0, pos); string = string.substr(pos); diff --git a/src/commands/modlogs.ts b/src/commands/modlogs.ts index 925b61b..f326669 100644 --- a/src/commands/modlogs.ts +++ b/src/commands/modlogs.ts @@ -32,7 +32,7 @@ export default class Modlogs extends Command { case 3: name = 'Unlock'; break; case 4: name = 'Delete'; break; } - const value = `**Account name:** ${username}\n**Moderator:** <@${moderatorID}>\n**Reason:** ${reason}\n**Date:** ${date.toLocaleString('en-us')} EST`; + const value = `**Account name:** ${username}\n**Moderator:** <@${moderatorID}>\n**Reason:** ${reason || 'Not supplied'}\n**Date:** ${date.toLocaleString('en-us')} EST`; const inline = true; return { name, value, inline }; });