Skip to content

Commit

Permalink
Merge pull request #1592 from tomusborne/bug/looper-data
Browse files Browse the repository at this point in the history
Bug - Looper children break when loop data is empty
  • Loading branch information
tomusborne authored Dec 13, 2024
2 parents e3c11ef + 9e61e98 commit f5e35c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/blocks/looper/components/LoopInnerBlocksRenderer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export function LoopInnerBlocksRenderer( props ) {
);

const loopItemsContext = useMemo( () => {
if ( hasResolvedData && Array.isArray( data ) ) {
if ( hasResolvedData && data?.length ) {
let { posts_per_page: perPage = 10, offset = 0 } = query;

// Ensure the params are a valid integer for comparison.
Expand Down

0 comments on commit f5e35c1

Please sign in to comment.