Skip to content

Commit 842545e

Browse files
PoohlPaul Weiß
andauthored
RenderStateCache: handle cache file open failures (#802)
Co-authored-by: Paul Weiß <paul.weiss@malighting.de>
1 parent dc6fb35 commit 842545e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Graphics/GraphicsTools/interface/RenderStateCache.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,10 @@ class RenderDeviceWithCache : public RenderDeviceX<ThrowOnError>
210210
if (pCacheData)
211211
{
212212
FileWrapper CacheDataFile{FilePath, EFileAccessMode::Overwrite};
213-
if (CacheDataFile->Write(pCacheData->GetConstDataPtr(), pCacheData->GetSize()))
213+
if (CacheDataFile && CacheDataFile->Write(pCacheData->GetConstDataPtr(), pCacheData->GetSize()))
214214
LOG_INFO_MESSAGE("Successfully saved state cache file ", FilePath, " (", FormatMemorySize(pCacheData->GetSize()), ").");
215+
else
216+
LOG_ERROR_MESSAGE("Failed to save state cache file ", FilePath, " (", FormatMemorySize(pCacheData->GetSize()), ").");
215217
}
216218
}
217219
else

0 commit comments

Comments
 (0)