From 3b25a8dbb6bc5ccee73f99fd0a0414d590e213d8 Mon Sep 17 00:00:00 2001 From: itsmelouis Date: Sun, 17 May 2026 18:36:14 +0200 Subject: [PATCH] fix(server): guard collection lookup against prototype keys --- src/runtime/server/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/server/api.ts b/src/runtime/server/api.ts index 6e1bad7a..719287e7 100644 --- a/src/runtime/server/api.ts +++ b/src/runtime/server/api.ts @@ -27,7 +27,7 @@ export default defineCachedEventHandler(async (event: H3Event) => { const options = useAppConfig().icon as NuxtIconRuntimeOptions const collectionName = event.context.params?.collection?.replace(/\.json$/, '') - const collection = collectionName + const collection = collectionName && Object.hasOwn(collections, collectionName) ? await collections[collectionName]?.() : null