Add null check for variants in Grid Layout (#13060)

This fixes a regression from 10.2.0 where the `variants` property was removed.
This commit is contained in:
Mads Rasmussen
2022-09-26 12:21:08 +02:00
committed by Nikolaj
parent 7493e5e1fd
commit 25a20cf741

View File

@@ -190,8 +190,8 @@
}
var contentLanguage = $scope.content.language;
var otherCreatedVariants = $scope.contentNodeModel.variants.filter(x => x.compositeId !== $scope.content.compositeId && (x.state !== "NotCreated" || x.name !== null)).length === 0;
var variants = $scope.contentNodeModel && $scope.contentNodeModel.variants || [];
var otherCreatedVariants = variants.filter(x => x.compositeId !== $scope.content.compositeId && (x.state !== "NotCreated" || x.name !== null)).length === 0;
var canEditCulture = !contentLanguage ||
// If the property culture equals the content culture it can be edited