Skip to content

Commit f96a4dc

Browse files
committed
fix(ContextMenu): improve handler invocation logic to prevent errors
1 parent ef1fe1c commit f96a4dc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

web/src/pages/FileExplorerPage/components/ContextMenu.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ export const ContextMenu: React.FC<ContextMenuProps> = (props) => {
260260
selectable={false}
261261
onClick={({ key }) => {
262262
const handler = handlerMap.get(String(key));
263-
if (handler) handler();
263+
if (!handler) return;
264+
handler();
264265
onClose();
265266
}}
266267
style={{ borderRadius: token.borderRadius, background: 'transparent', border: 'none' }}

0 commit comments

Comments
 (0)