From e47c126384216eee0eeb434b9a0d41863d88db19 Mon Sep 17 00:00:00 2001 From: Jai <814683@qq.com> Date: Wed, 7 Jul 2021 09:33:20 +0800 Subject: [PATCH] fix: when the directory does not exist, restoring the last opened tab will cause a crash --- src/App.xaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/App.xaml.cs b/src/App.xaml.cs index 823fb421..d7323cc3 100644 --- a/src/App.xaml.cs +++ b/src/App.xaml.cs @@ -89,6 +89,7 @@ namespace SourceGit { var actived = null as Models.Repository; if (restore.IsEnabled && restore.Opened.Count > 0) { foreach (var path in restore.Opened) { + if (!Directory.Exists(path)) continue; var repo = Models.Preference.Instance.FindRepository(path); if (repo != null) Models.Watcher.Open(repo); if (path == restore.Actived) actived = repo;