Fix file lock when loading asset fails

#1103
This commit is contained in:
Wojtek Figat
2023-05-16 11:52:49 +02:00
parent 1dd8aa3db8
commit a3ab7cd14e
2 changed files with 12 additions and 1 deletions

View File

@@ -760,9 +760,14 @@ bool Content::CloneAssetFile(const StringView& dstPath, const StringView& srcPat
// Change asset ID
{
auto storage = ContentStorageManager::GetStorage(tmpPath);
if (!storage)
{
LOG(Warning, "Cannot change asset ID.");
return true;
}
FlaxStorage::Entry e;
storage->GetEntry(0, e);
if (!storage || storage->ChangeAssetID(e, dstId))
if (storage->ChangeAssetID(e, dstId))
{
LOG(Warning, "Cannot change asset ID.");
return true;