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

commit b8d0d29031af7bb0175d70c6870f84946426d598
Author: Marat Gubaidullin <[email protected]>
AuthorDate: Tue Jan 10 19:14:23 2023 -0500

    Fix #597
---
 karavan-core/src/core/api/CamelDefinitionApiExt.ts | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/karavan-core/src/core/api/CamelDefinitionApiExt.ts 
b/karavan-core/src/core/api/CamelDefinitionApiExt.ts
index f1f6458..111847b 100644
--- a/karavan-core/src/core/api/CamelDefinitionApiExt.ts
+++ b/karavan-core/src/core/api/CamelDefinitionApiExt.ts
@@ -251,9 +251,11 @@ export class CamelDefinitionApiExt {
         const flows: any[] = [];
         integration.spec.flows?.forEach(flow => {
             if (flow.dslName === 'Beans') {
-                const beans = (flow as Beans).beans.filter(b => !(b.uuid === 
bean?.uuid && b.type === bean?.type));
-                const newBeans = new Beans({beans: beans});
-                flows.push(newBeans);
+                const beans: NamedBeanDefinition[] = (flow as 
Beans).beans.filter(b => !(b.uuid === bean?.uuid && b.type === bean?.type));
+                if (beans.length > 0) {
+                    const newBeans = new Beans({beans: beans});
+                    flows.push(newBeans);
+                }
             } else {
                 flows.push(flow);
             }

Reply via email to