Skip to content

Commit 6ab4a3f

Browse files
committed
fix(shape): check for a:off parent node on updating group position
1 parent 4fc5f2d commit 6ab4a3f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/helper/modify-shape-helper.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,12 @@ export default class ModifyShapeHelper {
5959
static setPosition =
6060
(pos: ShapeCoordinates) =>
6161
(element: XmlDocument | XmlElement): void => {
62-
const xfrm = element.getElementsByTagName('a:off')[0]
63-
.parentNode as XmlElement;
62+
const aOff = element.getElementsByTagName('a:off');
63+
if (!aOff?.item(0)) {
64+
return;
65+
}
66+
67+
const xfrm = aOff.item(0).parentNode as XmlElement;
6468

6569
Object.keys(pos).forEach((key) => {
6670
let value = Math.round(pos[key]);

0 commit comments

Comments
 (0)