mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-20 07:39:27 +08:00
Fixing NullReferenceExcepction in renaming Node
When I have no selected node and I press F2 key, NullReferenceException appears in method RenameSelectedNode(). I added not null condition, it is working now. Debugged in VS2017.
This commit is contained in:
@@ -295,8 +295,11 @@ namespace mRemoteNG.UI.Controls
|
||||
|
||||
public void RenameSelectedNode()
|
||||
{
|
||||
_allowEdit = true;
|
||||
SelectedItem.BeginEdit();
|
||||
if (SelectedItem != null)
|
||||
{
|
||||
_allowEdit = true;
|
||||
SelectedItem.BeginEdit();
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteSelectedNode()
|
||||
@@ -440,4 +443,4 @@ namespace mRemoteNG.UI.Controls
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user