BUG-1671: Fixed error that occurred when double-clicking systray icon before the first time a screenshot was saved to file

This commit is contained in:
JKlingen 2014-10-01 23:03:45 +02:00
commit 42437772ad
2 changed files with 13 additions and 7 deletions

View file

@ -1249,13 +1249,18 @@ namespace Greenshot {
switch (clickAction) {
case ClickActions.OPEN_LAST_IN_EXPLORER:
string path = null;
string configPath = FilenameHelper.FillVariables(_conf.OutputFilePath, false);
string lastFilePath = Path.GetDirectoryName(_conf.OutputFileAsFullpath);
if (lastFilePath != null && Directory.Exists(lastFilePath)) {
path = lastFilePath;
} else if (Directory.Exists(configPath)) {
path = configPath;
}
if (!string.IsNullOrEmpty(_conf.OutputFileAsFullpath)) {
string lastFilePath = Path.GetDirectoryName(_conf.OutputFileAsFullpath);
if (!string.IsNullOrEmpty(lastFilePath) && Directory.Exists(lastFilePath)) {
path = lastFilePath;
}
}
if (path == null) {
string configPath = FilenameHelper.FillVariables(_conf.OutputFilePath, false);
if (Directory.Exists(configPath)) {
path = configPath;
}
}
if (path != null) {
try {