Skip to content

Commit 98e17ef

Browse files
committed
MC-41013: Prevent errors from incorrect configurations
1 parent a0dccc0 commit 98e17ef

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/internal/Magento/Framework/View/Element/UiComponent/Argument/Interpreter/ConfigurableObject.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public function __construct(
8080
*/
8181
public function evaluate(array $data)
8282
{
83+
$type = null;
8384
if (isset($data['value'])) {
8485
$className = $data['value'];
8586
$arguments = [];
@@ -112,10 +113,12 @@ public function evaluate(array $data)
112113
}
113114
}
114115

115-
$type = $this->objectManagerConfig->getInstanceType(
116-
$this->objectManagerConfig->getPreference($className)
117-
);
118-
$classParents = $this->getParents($type);
116+
if ($type === null) {
117+
$type = $this->objectManagerConfig->getInstanceType(
118+
$this->objectManagerConfig->getPreference($className)
119+
);
120+
$classParents = array_merge([$type], $this->getParents($type));
121+
}
119122

120123
$deniedIntersection = array_intersect($classParents, $this->deniedClassList);
121124

0 commit comments

Comments
 (0)