From 6b7015aad6cba1a2ea3a62891c8910d92c1a41e0 Mon Sep 17 00:00:00 2001
From: Daniel Jones <admin@danieljon.es>
Date: Wed, 24 Jun 2020 15:51:52 +0930
Subject: fixed crash when deleting link with invalid selected gate

---
 MainWindow.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MainWindow.cpp b/MainWindow.cpp
index 3010f19..23ca61c 100644
--- a/MainWindow.cpp
+++ b/MainWindow.cpp
@@ -458,6 +458,8 @@ MainWindow::on_left_mouse_down(FXObject*, FXSelector, void *ptr)
 	FXEvent *ev = (FXEvent*)ptr;
 	lmouse_down = true;
 	Gate *gate = nullptr;
+	selected_input.gate = nullptr;
+	selected_input.input = -1;
 	if (selected_gate_type != Gate::NONE)
 	{
 		/* add new gate */
-- 
cgit v1.2.3