Skip to content

Commit

Permalink
check if varValue is array and key exists, maybe fixes #36
Browse files Browse the repository at this point in the history
  • Loading branch information
michb committed Dec 5, 2022
1 parent afc94b0 commit 53d0665
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Resources/contao/widgets/OpenGraphProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,13 @@ protected function generateWidgetsDCA( $value=null ): array {

foreach( $value as $keyRow => $row ) {

if( !array_key_exists($row[0], $options) ){
unset($this->varValue[$keyRow]);
$removedValues = true;
if( !array_key_exists($row[0], $options) ) {

if( is_array($this->varValue) && array_key_exists($keyRow, $this->varValue) ) {
unset($this->varValue[$keyRow]);
$removedValues = true;
}

continue;
}

Expand Down

0 comments on commit 53d0665

Please sign in to comment.