Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Commit 5b3cc5d

Browse files
committed
Merge pull request #49 from runegronkjaer/develop
Fix problem with editor config being undefined which will throw an er…
2 parents 18d4221 + c6fa8e8 commit 5b3cc5d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
};
5454

5555
$scope.setPreview = function (model) {
56-
if ("enablePreview" in $scope.control.editor.config && $scope.control.editor.config.enablePreview) {
56+
if ($scope.control.editor.config && "enablePreview" in $scope.control.editor.config && $scope.control.editor.config.enablePreview) {
5757
dtgeResources.getEditorMarkupForDocTypePartial(editorState.current.id, model.id,
5858
$scope.control.editor.alias, model.dtgeContentTypeAlias, model.value,
5959
$scope.control.editor.config.viewPath,
@@ -101,7 +101,7 @@
101101
}
102102

103103
// Load preview css / js files
104-
if ("enablePreview" in $scope.control.editor.config && $scope.control.editor.config.enablePreview)
104+
if ($scope.control.editor.config && "enablePreview" in $scope.control.editor.config && $scope.control.editor.config.enablePreview)
105105
{
106106
if ("previewCssFilePath" in $scope.control.editor.config && $scope.control.editor.config.previewCssFilePath) {
107107
assetsService.loadCss($scope.control.editor.config.previewCssFilePath, $scope);

0 commit comments

Comments
 (0)