diff --git a/extras/Introjucer/Source/Project/jucer_Project.cpp b/extras/Introjucer/Source/Project/jucer_Project.cpp index 6bcb6bc830..69c4d6ad56 100644 --- a/extras/Introjucer/Source/Project/jucer_Project.cpp +++ b/extras/Introjucer/Source/Project/jucer_Project.cpp @@ -542,7 +542,8 @@ bool Project::Item::renameFile (const File& newFile) { const File oldFile (getFile()); - if (oldFile.moveFileTo (newFile)) + if (oldFile.moveFileTo (newFile) + || (newFile.exists() && ! oldFile.exists())) { setFile (newFile); OpenDocumentManager::getInstance()->fileHasBeenRenamed (oldFile, newFile); diff --git a/modules/juce_core/files/juce_File.cpp b/modules/juce_core/files/juce_File.cpp index 33da2531aa..f61d5aeff6 100644 --- a/modules/juce_core/files/juce_File.cpp +++ b/modules/juce_core/files/juce_File.cpp @@ -229,6 +229,9 @@ bool File::moveFileTo (const File& newFile) const if (newFile.fullPath == fullPath) return true; + if (! exists()) + return false; + #if ! NAMES_ARE_CASE_SENSITIVE if (*this != newFile) #endif