fix deserialization order

This commit is contained in:
nzdev
2020-11-24 10:10:38 +13:00
parent 95fe8bea23
commit e8195bfff0

View File

@@ -48,7 +48,13 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
public ContentCacheDataModel Deserialize(int contentTypeId, string stringData, byte[] byteData)
{
if (stringData != null)
if (byteData != null)
{
var content = MessagePackSerializer.Deserialize<ContentCacheDataModel>(byteData, _options);
Expand(contentTypeId, content);
return content;
}
else if (stringData != null)
{
// NOTE: We don't really support strings but it's possible if manually used (i.e. tests)
var bin = Convert.FromBase64String(stringData);
@@ -56,12 +62,6 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
Expand(contentTypeId, content);
return content;
}
else if (byteData != null)
{
var content = MessagePackSerializer.Deserialize<ContentCacheDataModel>(byteData, _options);
Expand(contentTypeId, content);
return content;
}
else
{
return null;