Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 1ce645c

Browse files
kmanijakdanieldudzic
authored andcommitted
Add a safe guard that the variable is set before accessing it (#11424)
1 parent 975cb5b commit 1ce645c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/BlockTypes/ProductTemplate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected function render( $attributes, $content, $block ) {
6161
$classnames = '';
6262
if ( isset( $block->context['displayLayout'] ) && isset( $block->context['query'] ) ) {
6363
if ( isset( $block->context['displayLayout']['type'] ) && 'flex' === $block->context['displayLayout']['type'] ) {
64-
if ( $block->context['displayLayout']['shrinkColumns'] ) {
64+
if ( isset( $block->context['displayLayout']['shrinkColumns'] ) && $block->context['displayLayout']['shrinkColumns'] ) {
6565
$classnames = "wc-block-product-template__responsive columns-{$block->context['displayLayout']['columns']}";
6666
} else {
6767
$classnames = "is-flex-container columns-{$block->context['displayLayout']['columns']}";

0 commit comments

Comments
 (0)