[PowerToys Run] Fix corrupt/outdated plugins load crash (#12424)

* [PowerToys Run] Add type error catch and details

* [PowerToys Run] don't load outdated config plugins

Don't load plugins which don't have the new IcoPathDark and
IcoPathLight fields.
This commit is contained in:
Jaime Bernardo
2021-07-19 16:13:05 +01:00
committed by GitHub
parent f4a54b667e
commit e12e707704
2 changed files with 20 additions and 4 deletions

View File

@@ -94,6 +94,12 @@ namespace PowerLauncher.Plugin
return null;
}
if (string.IsNullOrEmpty(metadata.IcoPathDark) || string.IsNullOrEmpty(metadata.IcoPathLight))
{
Log.Error($"|PluginConfig.GetPluginMetadata|couldn't get icon information for config <{configPath}>", MethodBase.GetCurrentMethod().DeclaringType);
return null;
}
if (!File.Exists(metadata.ExecuteFilePath))
{
Log.Error($"|PluginConfig.GetPluginMetadata|execute file path didn't exist <{metadata.ExecuteFilePath}> for config <{configPath}", MethodBase.GetCurrentMethod().DeclaringType);