Skip to content

Commit a7d3f4d

Browse files
authored
fix(ContentQuery): handle null data (#1230)
1 parent 7c5fec2 commit a7d3f4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/components/ContentQuery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export default defineComponent({
187187
if (!data && slots?.['not-found']) { return slots['not-found']({ props, ...this.$attrs }) }
188188

189189
// Empty slots for `one` if type is "markdown" refers to an empty `body.children` key.
190-
if (data._type && data._type === 'markdown' && !data?.body?.children.length) { return slots.empty({ props, ...this.$attrs }) }
190+
if (data?._type === 'markdown' && !data?.body?.children.length) { return slots.empty({ props, ...this.$attrs }) }
191191
} else if (!data || !data.length) {
192192
// Handle `find()` and `findSurround()`
193193

0 commit comments

Comments
 (0)