diff options
author | bobzel <zzzman@gmail.com> | 2021-09-15 13:15:50 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-09-15 13:15:50 -0400 |
commit | afb0c5cb864815fee6ec357defe06813487f337a (patch) | |
tree | 01c86d9f14bb15ecbb3da06de455e214d1f02158 | |
parent | 2a287df36a6a2acbc5dad4360db6a6840573d364 (diff) |
avoid runtime error in compute group bounds on startup when docs are still promises.
-rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index cb912484f..362839852 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -1217,7 +1217,7 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P this._marqueeRef.current?.addEventListener("dashDragAutoScroll", this.onDragAutoScroll as any); this._disposers.groupBounds = reaction(() => { - if (this.props.Document._isGroup) { + if (this.props.Document._isGroup && this.childDocs.length) { const clist = this.childDocs.map(cd => ({ x: NumCast(cd.x), y: NumCast(cd.y), width: cd[WidthSym](), height: cd[HeightSym]() })); return aggregateBounds(clist, NumCast(this.layoutDoc._xPadding), NumCast(this.layoutDoc._yPadding)); } |