From 1c86bba21977e48685ba02b18269b8a9ae605192 Mon Sep 17 00:00:00 2001 From: Holly Date: Wed, 26 Mar 2025 21:50:25 +0000 Subject: [PATCH] fix dashboard throwing exception --- repos/MediaRepo.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/MediaRepo.ts b/repos/MediaRepo.ts index 3a6c148..0431e03 100644 --- a/repos/MediaRepo.ts +++ b/repos/MediaRepo.ts @@ -75,8 +75,8 @@ export default abstract class MediaRepo { public static async SelectTotalMediaSizeByUserId(userId: number) { const dbCount = await Database.Instance.query('SELECT SUM(FileSize) FROM Media WHERE IsDeleted = 0 AND UserId = ?', [ userId ]); - - return dbCount[0]["SUM(FileSize)"]; + + return dbCount[0]["SUM(FileSize)"] ?? 0; } public static async SelectTotalMediaByUserId(userId: number) {