diff options
author | bob <bcz@cs.brown.edu> | 2020-02-21 15:14:35 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2020-02-21 15:14:35 -0500 |
commit | 71d520aed2da2febca4458a7c5b33dcfdc23b731 (patch) | |
tree | 83b2c6aa5e178d9aed9bd2caf5c52bd17152e975 /src/new_fields/Doc.ts | |
parent | cc2ebdf4c19b2cc9065f3860807aa85e2576df22 (diff) |
added back tree view sorting.
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r-- | src/new_fields/Doc.ts | 4 |
1 files changed, 4 insertions, 0 deletions
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<Doc>, 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 }; |