diff --git a/src/elements/conditions/ElementCondition.php b/src/elements/conditions/ElementCondition.php index 478a7612478..59b84191cd6 100644 --- a/src/elements/conditions/ElementCondition.php +++ b/src/elements/conditions/ElementCondition.php @@ -81,7 +81,10 @@ public function __construct(?string $elementType = null, array $config = []) throw new InvalidConfigException("Invalid element type: $elementType"); } - $this->elementType = $elementType; + if ($elementType !== null) { + $this->elementType = $elementType; + } + parent::__construct($config); }