From 53d0665aabf817c0d66685fc9da44ab81f73d9d0 Mon Sep 17 00:00:00 2001 From: Michael Boesherz Date: Mon, 5 Dec 2022 14:36:32 +0100 Subject: [PATCH] check if varValue is array and key exists, maybe fixes #36 --- src/Resources/contao/widgets/OpenGraphProperties.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Resources/contao/widgets/OpenGraphProperties.php b/src/Resources/contao/widgets/OpenGraphProperties.php index 8293639..fc7574f 100644 --- a/src/Resources/contao/widgets/OpenGraphProperties.php +++ b/src/Resources/contao/widgets/OpenGraphProperties.php @@ -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; }