From 40455e199bf49fc12455f4263eef342f1ef13bde Mon Sep 17 00:00:00 2001 From: David Sparer Date: Wed, 28 Sep 2016 15:05:04 -0600 Subject: [PATCH] Fixed bug that would occasionally cause crashes when clicking --- mRemoteV1/UI/Window/ConnectionTreeWindow.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs index afbb3df93..98761fb9c 100644 --- a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs +++ b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs @@ -420,8 +420,9 @@ namespace mRemoteNG.UI.Window try { if (e.ClickCount > 1) return; - var clickedNode = (ConnectionInfo)e.Model; - + var clickedNode = e.Model as ConnectionInfo; + + if (clickedNode == null) return; if (clickedNode.GetTreeNodeType() != TreeNodeType.Connection && clickedNode.GetTreeNodeType() != TreeNodeType.PuttySession) return; if (Settings.Default.SingleClickOnConnectionOpensIt) ConnectionInitiator.OpenConnection(SelectedNode);