diff --git a/src/ViewModels/CodexEditViewModel.cs b/src/ViewModels/CodexEditViewModel.cs index 04a3310..1ca451d 100644 --- a/src/ViewModels/CodexEditViewModel.cs +++ b/src/ViewModels/CodexEditViewModel.cs @@ -71,10 +71,16 @@ public bool ShowLoading public RelayCommand BrowsePathCommand => _browsePathCommand ??= new(BrowsePath); private void BrowsePath() { + string? initialDir = Path.GetDirectoryName(TempCodex.Sources.Path); + if (!Path.Exists(initialDir)) + { + initialDir = string.Empty; + } + OpenFileDialog openFileDialog = new() { AddExtension = false, - InitialDirectory = Path.GetDirectoryName(TempCodex.Sources.Path) ?? String.Empty + InitialDirectory = initialDir }; if (openFileDialog.ShowDialog() == true) {