Add 'if' and 'else' to OpenAppDataButton

This would solve one of the issues I DM'd you about if the folder doesn't exist.
This commit is contained in:
Para 2020-05-03 10:24:30 -04:00 committed by GitHub
parent 9b878a43c3
commit 8c53243031
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -194,7 +194,14 @@ namespace ModAssistant.Pages
string location = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
"AppData", "LocalLow", "Hyperbolic Magnetism");
Utils.OpenFolder(location);
if (Directory.Exists(location)
{
Utils.OpenFolder(location);
}
else
{
MessageBox.Show((string)Application.Current.FindResource("Options:AppDataNotFound"));
}
}
private async void YeetBSIPAButton_Click(object sender, RoutedEventArgs e)