fix dashboard throwing exception

This commit is contained in:
Holly Stubbs 2025-03-26 21:50:25 +00:00
parent 43b38bc7e4
commit 1c86bba219
Signed by: tgpholly
GPG key ID: B8583C4B7D18119E

View file

@ -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) {