From 71d520aed2da2febca4458a7c5b33dcfdc23b731 Mon Sep 17 00:00:00 2001 From: bob Date: Fri, 21 Feb 2020 15:14:35 -0500 Subject: added back tree view sorting. --- src/new_fields/Doc.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/new_fields') diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 0af345a98..a24746caf 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -494,6 +494,10 @@ export namespace Doc { // if the childDoc is a template for a field, then this will return the expanded layout with its data doc. // otherwise, it just returns the childDoc export function GetLayoutDataDocPair(containerDoc: Doc, containerDataDoc: Opt, childDoc: Doc) { + if (!childDoc || !Doc.GetProto(childDoc)) { + console.log("No, no, no!"); + return { layout: childDoc, data: childDoc }; + } const existingResolvedDataDoc = childDoc[DataSym] !== Doc.GetProto(childDoc)[DataSym] && childDoc[DataSym]; const resolvedDataDoc = existingResolvedDataDoc || (Doc.AreProtosEqual(containerDataDoc, containerDoc) || !containerDataDoc || (!childDoc.isTemplateDoc && !childDoc.isTemplateForField) ? undefined : containerDataDoc); return { layout: Doc.expandTemplateLayout(childDoc, resolvedDataDoc), data: resolvedDataDoc }; -- cgit v1.2.3-70-g09d2