mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Stability fix for #1497
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2562 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
aefa2eace3
commit
0a900bc5d2
1 changed files with 6 additions and 4 deletions
|
@ -15,19 +15,21 @@ namespace ExternalCommand {
|
|||
if (commandName != null) {
|
||||
if (!iconCache.ContainsKey(commandName)) {
|
||||
Image icon = null;
|
||||
if (File.Exists(config.commandlines[commandName])) {
|
||||
if (config.commandlines.ContainsKey(commandName) && File.Exists(config.commandlines[commandName])) {
|
||||
try {
|
||||
icon = PluginUtils.GetExeIcon(config.commandlines[commandName], 0);
|
||||
} catch (Exception ex) {
|
||||
LOG.Warn("Problem loading icon for " + config.commandlines[commandName], ex);
|
||||
}
|
||||
}
|
||||
// Also add null to the cache if nothing is found
|
||||
iconCache.Add(commandName, icon);
|
||||
}
|
||||
return iconCache[commandName];
|
||||
} else {
|
||||
return null;
|
||||
if (iconCache.ContainsKey(commandName)) {
|
||||
return iconCache[commandName];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue