|
@@ -116,9 +116,14 @@ bool __fastcall TEditorManager::CanAddFile(const UnicodeString RemoteDirectory,
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- // get directory where the file already is so we download it there again
|
|
|
- ExistingLocalRootDirectory = FileData->Data->LocalRootDirectory;
|
|
|
- ExistingLocalDirectory = ExtractFilePath(FileData->FileName);
|
|
|
+ UnicodeString AExistingLocalDirectory = ExtractFilePath(FileData->FileName);
|
|
|
+ // If the temporary directory was deleted, behave like the file was never opened
|
|
|
+ if (DirectoryExists(AExistingLocalDirectory))
|
|
|
+ {
|
|
|
+ // get directory where the file already is so we download it there again
|
|
|
+ ExistingLocalRootDirectory = FileData->Data->LocalRootDirectory;
|
|
|
+ ExistingLocalDirectory = AExistingLocalDirectory;
|
|
|
+ }
|
|
|
CloseFile(i, false, false); // do not delete file
|
|
|
Result = true;
|
|
|
}
|