From e312e7050535ae8c4cca44bb94bebd7b88209019 Mon Sep 17 00:00:00 2001 From: alebinson Date: Wed, 17 Jan 2024 16:43:19 +0200 Subject: [PATCH] fix: imagery layer context menu --- src/common/hooks/mapMenus/useHandleMapMenuTemplates.hook.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/hooks/mapMenus/useHandleMapMenuTemplates.hook.ts b/src/common/hooks/mapMenus/useHandleMapMenuTemplates.hook.ts index 37bf9061..ff129df8 100644 --- a/src/common/hooks/mapMenus/useHandleMapMenuTemplates.hook.ts +++ b/src/common/hooks/mapMenus/useHandleMapMenuTemplates.hook.ts @@ -125,7 +125,10 @@ export const useHandleMapMenuTemplates = ( default: const tempGroup = {...groupTemplateMenuItem}; // Check if group holds WFS actions by presence at least one such item - const wfsFeature = groupTemplateMenuItem.items.find((item) => (item as MenuItem).action.action === ContextActions.QUERY_WFS_FEATURE) + const wfsFeature = groupTemplateMenuItem.items.find((item) => { + const menuItem = item as MenuItem; + return menuItem.action ? menuItem.action.action === ContextActions.QUERY_WFS_FEATURE : false; + }); if (wfsFeature) { tempGroup.groupProps.titleTranslationId = intl.formatMessage({ id: tempGroup.groupProps.titleTranslationId,