1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-17 08:30:06 +02:00

More sanity checking in file save ...

... against corruption as seen in:

http://forum.audacityteam.org/viewtopic.php?f=47&t=97787

Maybe this early check would have alerted the user sooner and prevented
trouble.
This commit is contained in:
Paul Licameli 2017-11-22 22:40:01 -05:00
parent 9c028c0761
commit 0532f9be37

View File

@ -1370,7 +1370,11 @@ std::pair<bool, wxString> DirManager::CopyToNewProjectDirectory(BlockFile *f)
}
wxFileNameWrapper newFileName;
if (!this->AssignFile(newFileName, oldFileNameRef.GetFullName(), false))
if (!this->AssignFile(newFileName, oldFileNameRef.GetFullName(), false)
// Another sanity check against blockfiles getting reassigned an empty
// name, as apparently happened in
// http://forum.audacityteam.org/viewtopic.php?f=47&t=97787 :
|| newFileName.GetFullName().empty() )
return { false, {} };
if (newFileName != oldFileNameRef) {