mirror of
https://github.com/excalidraw/excalidraw.git
synced 2024-11-02 03:25:53 +01:00
fix: Duplicating arrow without bound elements throws error (#8316)
Co-authored-by: David Luzar <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
parent
c641860cb1
commit
c67815f7b0
@ -1246,11 +1246,11 @@ export const fixBindingsAfterDuplication = (
|
||||
.filter(({ id }) => allBindableElementIds.has(id))
|
||||
.forEach((bindableElement) => {
|
||||
const oldElementId = duplicateIdToOldId.get(bindableElement.id);
|
||||
const { boundElements } = sceneElements.find(
|
||||
const boundElements = sceneElements.find(
|
||||
({ id }) => id === oldElementId,
|
||||
)!;
|
||||
)?.boundElements;
|
||||
|
||||
if (boundElements != null && boundElements.length > 0) {
|
||||
if (boundElements && boundElements.length > 0) {
|
||||
mutateElement(bindableElement, {
|
||||
boundElements: boundElements.map((boundElement) =>
|
||||
oldIdToDuplicatedId.has(boundElement.id)
|
||||
|
Loading…
Reference in New Issue
Block a user