Skip to content

Commit ba93f30

Browse files
committed
fix loading variants from registry
1 parent 9ada6c7 commit ba93f30

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: src/GenericModel.php

+3
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,9 @@ public static function get(string $id, bool $update = false): ?static
319319
// try to get the model from the registry
320320
if (static::$registry) {
321321
if ($registryModel = $registry->get(static::class, $id)) {
322+
if (!($registryModel instanceof static)) {
323+
return null;
324+
}
322325
$model = $registryModel;
323326
if (!$update) {
324327
return $model;

0 commit comments

Comments
 (0)