Skip to content

Commit

Permalink
magento#21853: Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikunj committed Aug 31, 2020
1 parent 7c2d2a6 commit 8388a90
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/internal/Magento/Framework/Mview/View/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ protected function getLinkedViews()
continue;
}
// Search in view subscriptions
foreach ($view->getSubscriptions() as $subscription) {
foreach ($view->getSubscriptions() ?? [] as $subscription) {
if ($subscription['name'] != $this->getTableName()) {
continue;
}
Expand All @@ -200,7 +200,12 @@ protected function buildStatement($event, $view)
{
// Get the subscription for the specific view and specific table.
// We will use column name from it.
$subscription = $view->getSubscriptions()[$this->getTableName()];
$subscriptions = $view->getSubscriptions() ?? [];
if (empty($subscriptions[$this->getTableName()])) {
return '';
}

$subscription = $subscriptions[$this->getTableName()];

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

0 comments on commit 8388a90

Please sign in to comment.