diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs index 66be08903..e859976bd 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs @@ -131,7 +131,17 @@ public abstract class ChromiumBookmarkLoader : IBookmarkLoader } catch (Exception ex) { - File.Delete(tempDbPath); + try + { + if (File.Exists(tempDbPath)) + { + File.Delete(tempDbPath); + } + } + catch (Exception ex1) + { + Main._context.API.LogException(ClassName, $"Failed to delete temporary favicon DB: {tempDbPath}", ex1); + } Main._context.API.LogException(ClassName, $"Failed to copy favicon DB: {dbPath}", ex); return; } diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs index 9ad31ad14..155069495 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs @@ -37,8 +37,6 @@ public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContex context.CurrentPluginMetadata.PluginCacheDirectoryPath, "FaviconCache"); - FilesFolders.ValidateDirectory(_faviconCacheDir); - LoadBookmarksIfEnabled(); } @@ -50,6 +48,9 @@ public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContex return; } + // Validate the cache directory before loading all bookmarks because Flow needs this directory to storage favicons + FilesFolders.ValidateDirectory(_faviconCacheDir); + _cachedBookmarks = BookmarkLoader.LoadAllBookmarks(_settings); _ = MonitorRefreshQueueAsync(); _initialized = true;