Skip to content

Commit

Permalink
[Settings]Fix crash showing non-existent New+ template folder (#35237)
Browse files Browse the repository at this point in the history
[Settings]Fix crash showing non-existent template folder
  • Loading branch information
jaimecbernardo authored Oct 3, 2024
1 parent 5770441 commit e717530
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/settings-ui/Settings.UI/ViewModels/NewPlusViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,21 @@ public void RefreshEnabledState()

private void OpenNewTemplateFolder()
{
var process = new ProcessStartInfo()
try
{
CopyTemplateExamples(_templateLocation);

var process = new ProcessStartInfo()
{
FileName = _templateLocation,
UseShellExecute = true,
};
Process.Start(process);
}
catch (Exception ex)
{
FileName = _templateLocation,
UseShellExecute = true,
};
Process.Start(process);
Logger.LogError("Failed to show NewPlus template folder.", ex);
}
}

private async void PickNewTemplateFolder()
Expand Down

0 comments on commit e717530

Please sign in to comment.