Skip to content

Commit

Permalink
chore: Tolerate null widget data
Browse files Browse the repository at this point in the history
  • Loading branch information
hellopablo committed Sep 4, 2024
1 parent 34ed3ca commit ede0240
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Cdn/Monitor/ObjectIsInTemplateWidgetData.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ protected function extractWidgetData(Entity $oEntity): object|array
protected function extractDetailsFromWidgetData(
array $aWidgets,
array $aMappings,
object|array $aWidgetData,
object|array|null $aWidgetData,
CdnObject $oObject,
Entity $oEntity
): array {

if (empty($aWidgetData)) {
return [];
}

$aDetails = [];
foreach ($aWidgetData as $sWidgetArea => $aData) {
$aDetails = array_merge(
Expand Down
6 changes: 5 additions & 1 deletion src/Cdn/Monitor/ObjectIsInWidgetData.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,15 @@ protected function extractWidgetData(Entity $oEntity): object|array
protected function extractDetailsFromWidgetData(
array $aWidgets,
array $aMappings,
object|array $aWidgetData,
object|array|null $aWidgetData,
CdnObject $oObject,
Entity $oEntity
): array {

if (empty($aWidgetData)) {
return [];
}

$aDetails = [];
foreach ($aWidgetData as $iIndex => $oWidget) {

Expand Down

0 comments on commit ede0240

Please sign in to comment.