Skip to content

Commit

Permalink
Cherry picked from 4c08b44
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdemooij9 authored and nul800sebastiaan committed May 18, 2022
1 parent 4fdbfee commit 4f48a49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -31,7 +31,8 @@ public ContentData ReadFrom(Stream stream)
var templateId = PrimitiveSerializer.Int32.ReadFrom(stream);
var properties = _dictionaryOfPropertyDataSerializer?.ReadFrom(stream); // TODO: We don't want to allocate empty arrays
var cultureInfos = s_defaultCultureVariationsSerializer.ReadFrom(stream); // TODO: We don't want to allocate empty arrays
return new ContentData(name, urlSegment, versionId, versionDate, writerId, templateId, published, properties, cultureInfos);
var cachedTemplateId = templateId == 0 ? (int?)null : templateId;
return new ContentData(name, urlSegment, versionId, versionDate, writerId, cachedTemplateId, published, properties, cultureInfos);
}

public void WriteTo(ContentData value, Stream stream)
Expand Down
Expand Up @@ -830,7 +830,7 @@ private ContentNodeKit CreateContentNodeKit(ContentSourceDto dto, IContentCacheD
dto.VersionId,
dto.EditVersionDate,
dto.EditWriterId,
dto.EditTemplateId,
dto.EditTemplateId == 0 ? null : dto.EditTemplateId,
published,
deserializedContent?.PropertyData,
deserializedContent?.CultureData);
Expand Down Expand Up @@ -859,7 +859,7 @@ private ContentNodeKit CreateContentNodeKit(ContentSourceDto dto, IContentCacheD
dto.VersionId,
dto.PubVersionDate,
dto.PubWriterId,
dto.PubTemplateId,
dto.PubTemplateId == 0 ? null : dto.PubTemplateId,
published,
deserializedContent?.PropertyData,
deserializedContent?.CultureData);
Expand Down

0 comments on commit 4f48a49

Please sign in to comment.