Skip to content

Commit

Permalink
fix(ContentQuery): handle null data (#1230)
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Jun 8, 2022
1 parent 7c5fec2 commit a7d3f4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/components/ContentQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export default defineComponent({
if (!data && slots?.['not-found']) { return slots['not-found']({ props, ...this.$attrs }) }

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

Expand Down

0 comments on commit a7d3f4d

Please sign in to comment.