Check return value from FileRead (#663)

Co-authored-by: Max Halldén <me@maxhallden.com>
This commit is contained in:
Max Halldén 2022-10-12 07:34:22 +02:00 committed by GitHub
parent 0fda7e39fe
commit aab6d0d081
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,6 +48,10 @@ namespace Steamworks
fixed ( byte* ptr = buffer )
{
var readsize = Internal.FileRead( filename, (IntPtr)ptr, size );
if ( readsize != size )
{
return null;
}
return buffer;
}
}