Fix error when loading surface from not yet loaded asset

This commit is contained in:
Wojtek Figat
2022-05-06 18:30:49 +02:00
parent 4cedd0f30c
commit 78d6fe6b50
9 changed files with 25 additions and 6 deletions

View File

@@ -75,6 +75,8 @@ AssetChunksFlag MaterialFunction::getChunksToPreload() const
BytesContainer MaterialFunction::LoadSurface()
{
BytesContainer result;
if (WaitForLoaded())
return result;
ScopeLock lock(Locker);
if (HasChunk(0))
{
@@ -89,6 +91,8 @@ BytesContainer MaterialFunction::LoadSurface()
bool MaterialFunction::LoadSurface(MaterialGraph& graph)
{
if (WaitForLoaded())
return true;
ScopeLock lock(Locker);
if (HasChunk(0))
{