From 7e115543fad2c44cdfe1b918767cef28de0711e6 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Thu, 18 Sep 2025 23:53:58 -0700 Subject: [PATCH] fix: prevent TypeError when nodeDef is undefined in NodeTooltip (#5659) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Fix TypeError in NodeTooltip component when `nodeDef` is undefined. This occurs when hovering over nodes whose type is not found in the nodeDefStore. ## Changes - Add optional chaining (`?.`) to `nodeDef.description` access on line 71 - Follows the same defensive pattern used in previous fixes for similar issues ## Context This addresses Sentry issue [CLOUD-FRONTEND-STAGING-1B](https://comfy-org.sentry.io/issues/6829258525/) which shows 19 occurrences affecting 14 users. The fix follows the same pattern as previous commits: - [290bf52fc](https://github.com/Comfy-Org/ComfyUI_frontend/commit/290bf52fc5cd240cbc81c13268e6aee9abc05526) - Fixed similar issue on line 112 - [e8997a765](https://github.com/Comfy-Org/ComfyUI_frontend/commit/e8997a7653e8b9d9a9e0f0e6e6d5e5e3e3e3e3e3) - Fixed multiple similar issues ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5659-fix-prevent-TypeError-when-nodeDef-is-undefined-in-NodeTooltip-2736d73d3650816e8be3f44889198b58) by [Unito](https://www.unito.io) --- src/components/graph/NodeTooltip.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/graph/NodeTooltip.vue b/src/components/graph/NodeTooltip.vue index f16e4ea3e..5f06386ba 100644 --- a/src/components/graph/NodeTooltip.vue +++ b/src/components/graph/NodeTooltip.vue @@ -68,7 +68,7 @@ const onIdle = () => { ctor.title_mode !== LiteGraph.NO_TITLE && canvas.graph_mouse[1] < node.pos[1] // If we are over a node, but not within the node then we are on its title ) { - return showTooltip(nodeDef.description) + return showTooltip(nodeDef?.description) } if (node.flags?.collapsed) return