Skip to content

Commit 8388a90

Browse files
author
nikunj
committed
#21853: Fix tests.
1 parent 7c2d2a6 commit 8388a90

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/internal/Magento/Framework/Mview/View/Subscription.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ protected function getLinkedViews()
178178
continue;
179179
}
180180
// Search in view subscriptions
181-
foreach ($view->getSubscriptions() as $subscription) {
181+
foreach ($view->getSubscriptions() ?? [] as $subscription) {
182182
if ($subscription['name'] != $this->getTableName()) {
183183
continue;
184184
}
@@ -200,7 +200,12 @@ protected function buildStatement($event, $view)
200200
{
201201
// Get the subscription for the specific view and specific table.
202202
// We will use column name from it.
203-
$subscription = $view->getSubscriptions()[$this->getTableName()];
203+
$subscriptions = $view->getSubscriptions() ?? [];
204+
if (empty($subscriptions[$this->getTableName()])) {
205+
return '';
206+
}
207+
208+
$subscription = $subscriptions[$this->getTableName()];
204209

205210
// Get the changelog from View to get changelog column name.
206211
$changelog = $view->getChangelog();

0 commit comments

Comments
 (0)