This is an automated email from the ASF dual-hosted git repository.

marat pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karavan.git


The following commit(s) were added to refs/heads/main by this push:
     new f338fb5  Update CamelDisplayUtil.ts
f338fb5 is described below

commit f338fb563d9376c21ac02605e131eb70316c1787
Author: Marat Gubaidullin <marat.gubaidul...@gmail.com>
AuthorDate: Thu Aug 11 18:49:32 2022 -0400

    Update CamelDisplayUtil.ts
---
 karavan-core/src/core/api/CamelDisplayUtil.ts | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/karavan-core/src/core/api/CamelDisplayUtil.ts 
b/karavan-core/src/core/api/CamelDisplayUtil.ts
index 9954b08..6311d87 100644
--- a/karavan-core/src/core/api/CamelDisplayUtil.ts
+++ b/karavan-core/src/core/api/CamelDisplayUtil.ts
@@ -32,9 +32,11 @@ export class CamelDisplayUtil {
     static getParentStepDefinitions = (flows: CamelElement[] | undefined, 
uuid: string): string[] => {
         const result: string[] = [];
         let meta = CamelDefinitionApiExt.findStep(flows, uuid);
+        if (meta)
         while (meta.step?.dslName !== 'FromDefinition') {
             if (meta.step?.dslName === 'StepDefinition') 
result.push(meta.step.uuid);
-            if (meta.parentUuid) meta = CamelDefinitionApiExt.findStep(flows, 
meta.parentUuid);
+            if (meta.parentUuid) meta = CamelDefinitionApiExt.findStep(flows, 
meta.parentUuid)
+            else break;
         }
         return result;
     }

Reply via email to