fix: LGraphCanvas: add type guard for widget.getContextMenuOptions() and validate returned value (#9390)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
CodeRabbit Fixer
2026-03-06 16:00:22 +01:00
parent 610bd70e4e
commit 5edb16e7f3

View File

@@ -14,7 +14,7 @@ import type { CanvasPointerEvent } from '../types/events'
import type { LGraphCanvas } from '../LGraphCanvas'
import type { LGraphNode } from '../LGraphNode'
export interface IWidgetWithContextMenu extends IBaseWidget {
interface IWidgetWithContextMenu extends IBaseWidget {
getContextMenuOptions(opts: {
e: CanvasPointerEvent
node: LGraphNode