Skip to content

Commit

Permalink
Fixing TabView null ref crash (#6987)
Browse files Browse the repository at this point in the history
  • Loading branch information
RBrid authored Apr 18, 2022
1 parent e754cfb commit e25a162
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dev/TabView/TabView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,20 +702,23 @@ void TabView::OnItemsPresenterSizeChanged(const winrt::IInspectable& sender, con

void TabView::BringSelectedTabIntoView()
{
if(SelectedItem())
if (SelectedItem())
{
auto tvi = SelectedItem().try_as<winrt::TabViewItem>();
if (!tvi)
{
tvi = ContainerFromItem(SelectedItem()).try_as<winrt::TabViewItem>();
}
winrt::get_self<TabViewItem>(tvi)->StartBringTabIntoView();
if (tvi)
{
winrt::get_self<TabViewItem>(tvi)->StartBringTabIntoView();
}
}
}

void TabView::OnItemsChanged(winrt::IInspectable const& item)
{
if(m_isDragging)
if (m_isDragging)
{
return;
}
Expand Down

0 comments on commit e25a162

Please sign in to comment.