mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add error handling for directory operation
This commit is contained in:
parent
57470a9799
commit
f59e2399b9
1 changed files with 14 additions and 8 deletions
|
|
@ -294,16 +294,22 @@ public class FirefoxBookmarkLoader : FirefoxBookmarkLoaderBase
|
||||||
{
|
{
|
||||||
var platformPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
var platformPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
||||||
var packagesPath = Path.Combine(platformPath, "Packages");
|
var packagesPath = Path.Combine(platformPath, "Packages");
|
||||||
|
try
|
||||||
// Search for folder with Mozilla.Firefox prefix
|
{
|
||||||
var firefoxPackageFolder = Directory.EnumerateDirectories(packagesPath, "Mozilla.Firefox*",
|
// Search for folder with Mozilla.Firefox prefix
|
||||||
SearchOption.TopDirectoryOnly).FirstOrDefault();
|
var firefoxPackageFolder = Directory.EnumerateDirectories(packagesPath, "Mozilla.Firefox*",
|
||||||
|
SearchOption.TopDirectoryOnly).FirstOrDefault();
|
||||||
|
|
||||||
// Msix FireFox not installed
|
// Msix FireFox not installed
|
||||||
if (firefoxPackageFolder == null) return string.Empty;
|
if (firefoxPackageFolder == null) return string.Empty;
|
||||||
|
|
||||||
var profileFolderPath = Path.Combine(firefoxPackageFolder, @"LocalCache\Roaming\Mozilla\Firefox");
|
var profileFolderPath = Path.Combine(firefoxPackageFolder, @"LocalCache\Roaming\Mozilla\Firefox");
|
||||||
return GetProfileIniPath(profileFolderPath);
|
return GetProfileIniPath(profileFolderPath);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue