From fdb0cf508ae9e14ae5d0c2f7b12077942b74c9bd Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 7 Jun 2025 14:02:32 +0800 Subject: [PATCH] Fix null check --- .../ViewModels/SettingsViewModel.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs index cd315a085..ff6516998 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs @@ -360,18 +360,20 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels private void AddIndexSearchExcludePaths() { var container = Settings.IndexSearchExcludedSubdirectoryPaths; + + if (container is null) return; var folderBrowserDialog = new FolderBrowserDialog(); if (folderBrowserDialog.ShowDialog() != DialogResult.OK) return; - + var newAccessLink = new AccessLink { Name = folderBrowserDialog.SelectedPath.GetPathName(), Path = folderBrowserDialog.SelectedPath }; - + container.Add(newAccessLink); Save(); }