added protection when creating uwp

This commit is contained in:
AT 2019-11-01 21:44:55 +02:00
parent e35ad892eb
commit d2ca74ecdf

View File

@ -196,11 +196,20 @@ namespace Wox.Plugin.Program.Programs
ps = ps.Where(p =>
{
bool valid;
try
{
var f = p.IsFramework;
var d = p.IsDevelopmentMode;
var path = p.InstalledLocation.Path;
valid = !f && !d && !string.IsNullOrEmpty(path);
}
catch (Exception e)
{
ProgramLogger.LogException("|UWP|CurrentUserPackages|An unexpected error occured and "
+ $"unable to verify if package is valid", e);
return false;
}
return valid;
});