From 0260b4889dcb99b3e812dda91cb241a9b8425dce Mon Sep 17 00:00:00 2001 From: Ajay Date: Fri, 27 May 2022 19:07:44 -0400 Subject: [PATCH] safe navigate in user vip --- src/utils/isUserVIP.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/isUserVIP.ts b/src/utils/isUserVIP.ts index 4e2ed46..b4ac6c1 100644 --- a/src/utils/isUserVIP.ts +++ b/src/utils/isUserVIP.ts @@ -2,5 +2,5 @@ import { db } from "../databases/databases"; import { HashedUserID } from "../types/user.model"; export async function isUserVIP(userID: HashedUserID): Promise { - return (await db.prepare("get", `SELECT count(*) as "userCount" FROM "vipUsers" WHERE "userID" = ? LIMIT 1`, [userID])).userCount > 0; + return (await db.prepare("get", `SELECT count(*) as "userCount" FROM "vipUsers" WHERE "userID" = ? LIMIT 1`, [userID]))?.userCount > 0; }