Check for null and return
MODIFY
WalletWasabi.Fluent/ViewModels/NavBar/NavBarViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBar/NavBarViewModel.cs
@@ -174,7 +174,12 @@ namespace WalletWasabi.Fluent.ViewModels.NavBar
private void SetSelectedItem(NavBarItemViewModel? value)
{
- if (value is null || value.SelectionMode == NavBarItemSelectionMode.Selected)
+ if (value is null)
+ {
+ return;
+ }
+
+ if (value.SelectionMode == NavBarItemSelectionMode.Selected)
{
Select(value);
return;
@@ -214,7 +219,7 @@ namespace WalletWasabi.Fluent.ViewModels.NavBar
{
if (walletManager.Items.Contains(x) || _topItems.Contains(x) || _bottomItems.Contains(x))
{
- if (!_isNavigating && x.SelectionMode == NavBarItemSelectionMode.Selected)
+ if (!_isNavigating)
{
_isNavigating = true;
SetSelectedItem(x);

Check for null and return