Browse Source
Merge pull request #5858 from Afanyiyu/treeview-bugfix
fix: Fix ArgumentNullException in TreeView.ExpandSubTree()
pull/6212/head
Max Katz
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
4 deletions
-
src/Avalonia.Controls/TreeView.cs
|
|
|
@ -166,11 +166,9 @@ namespace Avalonia.Controls |
|
|
|
{ |
|
|
|
item.IsExpanded = true; |
|
|
|
|
|
|
|
var panel = item.Presenter.Panel; |
|
|
|
|
|
|
|
if (panel != null) |
|
|
|
if (item.Presenter?.Panel != null) |
|
|
|
{ |
|
|
|
foreach (var child in panel.Children) |
|
|
|
foreach (var child in item.Presenter.Panel.Children) |
|
|
|
{ |
|
|
|
if (child is TreeViewItem treeViewItem) |
|
|
|
{ |
|
|
|
|