diff --git a/src/drawApp/jkApp.ts b/src/drawApp/jkApp.ts index e3a1933..5df8a5a 100644 --- a/src/drawApp/jkApp.ts +++ b/src/drawApp/jkApp.ts @@ -184,14 +184,14 @@ export async function loadLinkDatas(app: IDrawApp) { length: link.length, index: link.index, aRelatedRef: new graphicData.RelatedRef({ - id: link.aRelatedRef.id, - deviceType: link.aRelatedRef.deviceType, - devicePort: link.aRelatedRef.devicePort || 0, + id: link.aRelatedRef?.id, + deviceType: link.aRelatedRef?.deviceType, + devicePort: link.aRelatedRef?.devicePort || 0, }), bRelatedRef: new graphicData.RelatedRef({ - id: link.bRelatedRef.id, - deviceType: link.bRelatedRef.deviceType, - devicePort: link.bRelatedRef.devicePort || 0, + id: link.bRelatedRef?.id, + deviceType: link.bRelatedRef?.deviceType, + devicePort: link.bRelatedRef?.devicePort || 0, }), devicePositions: ((): graphicData.CalculateLink.DevicePosition[] => { const dps: graphicData.CalculateLink.DevicePosition[] = [];