From 17cdb501a3988b2db547f7ecc450bcc697573461 Mon Sep 17 00:00:00 2001 From: Jas Laferriere Date: Mon, 3 Jul 2023 23:57:06 -0400 Subject: [PATCH] fix: dont show current time when time missing --- src/replays/loadFile.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/replays/loadFile.ts b/src/replays/loadFile.ts index d06fa09c2..7db02cd70 100644 --- a/src/replays/loadFile.ts +++ b/src/replays/loadFile.ts @@ -1,3 +1,4 @@ +import { exists } from "@common/exists"; import type { GameStartType, MetadataType } from "@slippi/slippi-js"; import { SlippiGame } from "@slippi/slippi-js"; import * as fs from "fs-extra"; @@ -48,6 +49,10 @@ export async function loadFile(fullPath: string): Promise { } function convertToDateAndTime(dateTimeString: moment.MomentInput): moment.Moment | null { + if (!exists(dateTimeString)) { + return null; + } + const asMoment = moment(dateTimeString); if (asMoment.isValid()) { return asMoment.local();