From b680b47ce11d8648a55e2f88cf2ccd4bcecd3369 Mon Sep 17 00:00:00 2001 From: Farnabaz Date: Wed, 30 Aug 2023 12:42:12 +0200 Subject: [PATCH] fix(query): prevent `undefined` error --- src/runtime/query/query.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/query/query.ts b/src/runtime/query/query.ts index 7a0c1ea9b..f5db45d99 100644 --- a/src/runtime/query/query.ts +++ b/src/runtime/query/query.ts @@ -35,6 +35,10 @@ export function createQuery (fetcher: ContentQueryFetcher return result.surround } + if (!result) { + return result + } + if ((result as any)?.dirConfig) { result.result = { _path: (result as any).dirConfig?._path,