From 72f031b0aefcb9fa63a9f0e2250fa5c99af8c562 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Wed, 21 May 2025 11:06:49 -0300 Subject: [PATCH] fix: prevent unexpected undefined playTimeInMilliseconds value --- src/main/services/process-watcher.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/services/process-watcher.ts b/src/main/services/process-watcher.ts index 7dddab8b..1bd94e2b 100644 --- a/src/main/services/process-watcher.ts +++ b/src/main/services/process-watcher.ts @@ -250,7 +250,7 @@ function onTickGame(game: Game) { gamesSublevel.put(levelKeys.game(game.shop, game.objectId), { ...game, - playTimeInMilliseconds: game.playTimeInMilliseconds + delta, + playTimeInMilliseconds: (game.playTimeInMilliseconds ?? 0) + delta, lastTimePlayed: new Date(), });