Merge pull request #106 from LukeOrdelmans/bugfix/fix-null-reference-on-disconnected-treenode
Fixed a NullReferenceException caused by handling a left mouse click on a child node
This commit is contained in:
Коммит
0dfcaeb54d
|
@ -56,10 +56,8 @@ namespace ICSharpCode.WpfDesign.Designer.OutlineView
|
|||
protected override void SelectOnly(DragTreeViewItem item)
|
||||
{
|
||||
base.SelectOnly(item);
|
||||
|
||||
var node = item.DataContext as IOutlineNode;
|
||||
|
||||
if (node.DesignItem != null) {
|
||||
if (item.DataContext is IOutlineNode node && node.DesignItem != null) {
|
||||
var surface = node.DesignItem.View.TryFindParent<DesignSurface>();
|
||||
if (surface != null)
|
||||
surface.ScrollIntoView(node.DesignItem);
|
||||
|
|
Загрузка…
Ссылка в новой задаче