From 2f088e403b47f2380e05ec2448a5902af0cca289 Mon Sep 17 00:00:00 2001 From: Sarah Norris <1645628+mikachan@users.noreply.github.com> Date: Thu, 31 Oct 2024 20:10:18 +0000 Subject: [PATCH] Query Loop: Check for postTypeFromContext before using it (#66655) Co-authored-by: mikachan Co-authored-by: ellatrix --- packages/block-library/src/post-template/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/post-template/edit.js b/packages/block-library/src/post-template/edit.js index 4e7e514ed82b1..b28c726acfc77 100644 --- a/packages/block-library/src/post-template/edit.js +++ b/packages/block-library/src/post-template/edit.js @@ -188,7 +188,7 @@ export default function PostTemplateEdit( { // When we preview Query Loop blocks we should prefer the current // block's postType, which is passed through block context. const usedPostType = - postTypeFromContext !== 'page' + postTypeFromContext && postTypeFromContext !== 'page' ? postTypeFromContext : previewPostType || postType; return {