Skip to content

Commit 7239ebd

Browse files
committed
Prevent null reference exception
1 parent ba55bb7 commit 7239ebd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Files.App/Views/Properties/HashesPage.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ private void HashInputTextBox_TextChanged(object sender, TextChangedEventArgs e)
6363

6464
if (string.IsNullOrEmpty(matchingAlgorithm))
6565
{
66+
HashesViewModel.InfoBarVisible = true;
6667
HashMatchInfoBar.Severity = InfoBarSeverity.Error;
6768
HashMatchInfoBar.Title = Strings.HashesDoNotMatch.GetLocalizedResource();
68-
HashesViewModel.InfoBarVisible = true;
6969
return;
7070
}
7171
else
7272
{
73+
HashesViewModel.InfoBarVisible = true;
7374
HashMatchInfoBar.Severity = InfoBarSeverity.Success;
7475
HashMatchInfoBar.Title = string.Format(Strings.HashesMatch.GetLocalizedResource(), matchingAlgorithm);
75-
HashesViewModel.InfoBarVisible = true;
7676
return;
7777
}
7878
}
@@ -82,6 +82,8 @@ private async void CompareFileButton_Click(object sender, RoutedEventArgs e)
8282
{
8383
var result = await HashesViewModel.CompareFileAsync();
8484

85+
HashesViewModel.InfoBarVisible = true;
86+
8587
if (result)
8688
{
8789
HashMatchInfoBar.Severity = InfoBarSeverity.Success; // Check mark
@@ -92,8 +94,6 @@ private async void CompareFileButton_Click(object sender, RoutedEventArgs e)
9294
HashMatchInfoBar.Severity = InfoBarSeverity.Error; // Cross mark
9395
HashMatchInfoBar.Title = "no";
9496
}
95-
96-
HashesViewModel.InfoBarVisible = true;
9797
}
9898

9999
private void MenuFlyout_Closing(FlyoutBase sender, FlyoutBaseClosingEventArgs e)

0 commit comments

Comments
 (0)