diff --git a/lib/db/views.ts b/lib/db/views.ts index a0cfbabb..8ec28614 100644 --- a/lib/db/views.ts +++ b/lib/db/views.ts @@ -51,8 +51,9 @@ export async function getLastViews(type: Types, n: number) { await Promise.all( sorted.map(async (s) => { const data = await findOneTyped(type, s.contentId) - - data.views = s.count + if (data !== null) { + data.views = s.count + } return data }) )