From dbc128d0c2b5cb3c6769246fdf841f2c918573b1 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 26 Apr 2020 11:54:51 +0900 Subject: [PATCH] enhance(server): Resolve #6286 --- src/misc/id/aid.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/misc/id/aid.ts b/src/misc/id/aid.ts index c49a08457..2bcde90bf 100644 --- a/src/misc/id/aid.ts +++ b/src/misc/id/aid.ts @@ -18,6 +18,8 @@ function getNoise() { } export function genAid(date: Date): string { + const t = date.getTime(); + if (isNaN(t)) throw 'Failed to create AID: Invalid Date'; counter++; - return getTime(date.getTime()) + getNoise(); + return getTime(t) + getNoise(); }