Handle failed node descriptor lookups more gracefully

We made this change in one place, but not in another. The real fix is to make both places use the same copy of `resolveNodeDescriptor`, but that'll have to wait another month.
This commit is contained in:
Andrew Dupont 2024-06-13 14:07:41 -07:00
parent ca02c51da5
commit b61e491f2e

View File

@ -79,7 +79,7 @@ function resolveNodePosition(node, descriptor) {
let result = parts.length === 0 ?
node :
resolveNodeDescriptor(node, parts.join('.'));
if (!result) { return null; }
return result[lastPart];
}
@ -2535,6 +2535,7 @@ class FoldResolver {
let value = options[key];
end = this.applyFoldAdjustment(key, end, node, value, props, this.layer);
}
if (!end) { return null; }
end = Point.fromObject(end, true);
end = this.buffer.clipPosition(end);