Browse Source

Fix null annotation

pull/20531/head
Petar Tasev 8 months ago
parent
commit
303bd0a015
  1. 14
      src/Avalonia.Controls/TreeViewItem.cs

14
src/Avalonia.Controls/TreeViewItem.cs

@ -192,12 +192,16 @@ namespace Avalonia.Controls
}
var header = _headerPresenter ?? _header;
var m = header?.TransformToVisual(this);
if (m.HasValue)
if (header is not null)
{
var bounds = new Rect(header.Bounds.Size);
var rect = bounds.TransformToAABB(m.Value);
e.TargetRect = rect;
var m = header.TransformToVisual(this);
if (m.HasValue)
{
var bounds = new Rect(header.Bounds.Size);
var rect = bounds.TransformToAABB(m.Value);
e.TargetRect = rect;
}
}
}
}

Loading…
Cancel
Save