Adds some null checks, need to see if tests pass
This commit is contained in:
@@ -1028,8 +1028,13 @@ namespace Umbraco.Web.PublishedCache.NuCache
|
||||
{
|
||||
parentLink = parentLink ?? GetRequiredParentLink(content, null);
|
||||
|
||||
// TODO: This can result in a null value? see https://github.com/umbraco/Umbraco-CMS/issues/7868
|
||||
// It seems to be related to having corrupt Paths in the umbracoNode table.
|
||||
var parent = parentLink.Value;
|
||||
|
||||
if (parent == null)
|
||||
throw new PanicException($"A null Value was returned on the {nameof(parentLink)} LinkedNode with id={content.ParentContentId}, potentially your database paths are corrupted, please see the HealthCheck dashboard and fixup data inconsistencies.");
|
||||
|
||||
// if parent has no children, clone parent + add as first child
|
||||
if (parent.FirstChildContentId < 0)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Umbraco.Web.PublishedCache.NuCache.Snap
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Web.PublishedCache.NuCache.Snap
|
||||
{
|
||||
//NOTE: This cannot be struct because it references itself
|
||||
|
||||
@@ -11,7 +13,7 @@
|
||||
{
|
||||
public LinkedNode(TValue value, long gen, LinkedNode<TValue> next = null)
|
||||
{
|
||||
Value = value;
|
||||
Value = value ?? throw new ArgumentNullException(nameof(value));
|
||||
Gen = gen;
|
||||
Next = next;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user