diff --git a/packages/project-editor/flow/component.tsx b/packages/project-editor/flow/component.tsx index 49418362..eeb7f1d0 100644 --- a/packages/project-editor/flow/component.tsx +++ b/packages/project-editor/flow/component.tsx @@ -2553,15 +2553,17 @@ export class EventHandler extends EezObject { }, deleteObjectRefHook: (eventHandler: EventHandler) => { - const widget = getAncestorOfType( - eventHandler, - ProjectEditor.WidgetClass.classInfo - )!; - - ProjectEditor.getFlow(widget).deleteConnectionLinesFromOutput( - widget, - eventHandler.eventName - ); + if (eventHandler.handlerType == "flow") { + const widget = getAncestorOfType( + eventHandler, + ProjectEditor.WidgetClass.classInfo + )!; + + ProjectEditor.getFlow(widget).deleteConnectionLinesFromOutput( + widget, + eventHandler.eventName + ); + } }, defaultValue: {