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

Commit b50fb9d

Browse files
author
Dan Lister
committed
Fixes empty control exception when a document type is not saved after adding a cell
Steps to reproduce exception: - Choose a layout - Add an element - Select any DTGE element - Choose the Cancel button A layout should then contain an empty cell which holds no data due to the document type instance not being saved. When rendering the grid on a page template, the following change is required as the `docTypeAlias` parameter is empty. I'm not sure whether the issue is related to the grid or the DTGE but the change proposed appears to fix the issue.
1 parent 3dec042 commit b50fb9d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Src/Our.Umbraco.DocTypeGridEditor/Helpers/DocTypeGridEditorHelper.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ private static ServiceContext Services
2323

2424
public static IPublishedContent ConvertValueToContent(string id, string docTypeAlias, string dataJson)
2525
{
26+
if (string.IsNullOrWhiteSpace(docTypeAlias))
27+
return null;
28+
2629
return (IPublishedContent)ApplicationContext.Current.ApplicationCache.RequestCache.GetCacheItem(
2730
"DocTypeGridEditorHelper.ConvertValueToContent_" + id + "_" + docTypeAlias, () =>
2831
{

0 commit comments

Comments
 (0)