Skip to content

Commit 86d191a

Browse files
committed
check fieldLayoutId for category group too
1 parent 6bd8ddf commit 86d191a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/fields/Categories.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,11 @@ public static function getMatchFields(FeedModel $feed, ?BaseRelationField $field
241241
if (!$categoryGroup) {
242242
return FieldHelper::getAllUniqueIdFields();
243243
}
244-
$fieldLayout = Craft::$app->getFields()->getLayoutById($categoryGroup->fieldLayoutId);
244+
245+
$fieldLayout = null;
246+
if ($categoryGroup->fieldLayoutId) {
247+
$fieldLayout = Craft::$app->getFields()->getLayoutById($categoryGroup->fieldLayoutId);
248+
}
245249
if (!$fieldLayout) {
246250
return FieldHelper::getAllUniqueIdFields();
247251
}

0 commit comments

Comments
 (0)