Cleanup destination directory during DiskCacheWrapper::moveFile()

This commit is contained in:
Pavel Kovalenko 2021-03-18 10:23:19 +03:00
parent e6711e936e
commit 7c0a1b9451

View File

@ -217,7 +217,7 @@ void DiskCacheWrapper::moveFile(const String & from_path, const String & to_path
{
if (cache_disk->exists(from_path))
{
if (cache_disk->isDirectory(to_path) && !cache_disk->isDirectoryEmpty(to_path))
if (cache_disk->exists(to_path) && cache_disk->isDirectory(to_path))
cache_disk->clearDirectory(to_path);
auto dir_path = directoryPath(to_path);