mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-25 19:38:37 +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()
|
public void RenameSelectedNode()
|
||||||
{
|
{
|
||||||
_allowEdit = true;
|
if (SelectedItem != null)
|
||||||
SelectedItem.BeginEdit();
|
{
|
||||||
|
_allowEdit = true;
|
||||||
|
SelectedItem.BeginEdit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DeleteSelectedNode()
|
public void DeleteSelectedNode()
|
||||||
@@ -440,4 +443,4 @@ namespace mRemoteNG.UI.Controls
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user