From 784b9cc44133e963cc320b03d022c67c16441d48 Mon Sep 17 00:00:00 2001 From: Adisak Date: Mon, 5 Jan 2026 13:11:55 +0700 Subject: [PATCH] fix --- src/services/PositionService.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/services/PositionService.ts b/src/services/PositionService.ts index 0562f458..1b30f980 100644 --- a/src/services/PositionService.ts +++ b/src/services/PositionService.ts @@ -60,11 +60,11 @@ export async function CreatePosMasterHistoryOfficer( h.firstName = pm.current_holder?.firstName || _null; h.lastName = pm.current_holder?.lastName || _null; h.profileId = pm.current_holder?.id || _null; - h.rootDnaId = pm.orgRoot.ancestorDNA || _null; - h.child1DnaId = pm.orgChild1.ancestorDNA || _null; - h.child2DnaId = pm.orgChild2.ancestorDNA || _null; - h.child3DnaId = pm.orgChild3.ancestorDNA || _null; - h.child4DnaId = pm.orgChild4.ancestorDNA || _null; + h.rootDnaId = pm.orgRoot?.ancestorDNA || _null; + h.child1DnaId = pm.orgChild1?.ancestorDNA || _null; + h.child2DnaId = pm.orgChild2?.ancestorDNA || _null; + h.child3DnaId = pm.orgChild3?.ancestorDNA || _null; + h.child4DnaId = pm.orgChild4?.ancestorDNA || _null; } else { h.prefix = pm.next_holder?.prefix || _null; h.firstName = pm.next_holder?.firstName || _null;