BUG-2095: Improved the validity check of the OutputFileAsFullpath setting, this should prevent a reset if only the file is not available.

This commit is contained in:
Robin 2017-01-14 20:18:04 +01:00
parent 25d9c17bed
commit c77e77578d
2 changed files with 6 additions and 3 deletions

View file

@ -69,7 +69,8 @@ namespace GreenshotPlugin.Controls {
string initialDirectory = null;
try {
// Added for BUG-1992, reset the OutputFilePath / OutputFileAsFullpath if they don't exist (e.g. the configuration is used on a different PC)
if (!File.Exists(conf.OutputFileAsFullpath))
var outputFilePath = Path.GetDirectoryName(conf.OutputFileAsFullpath);
if (outputFilePath == null || (!File.Exists(conf.OutputFileAsFullpath) && !Directory.Exists(outputFilePath)))
{
conf.OutputFileAsFullpath = conf.GetDefault(nameof(conf.OutputFileAsFullpath)) as string;
}