Null pointer check fix

This commit is contained in:
Garry Newman 2017-02-01 12:20:47 +00:00
parent 6e7afc1ac9
commit b7564630cd
2 changed files with 4 additions and 1 deletions

View File

@ -47,6 +47,9 @@ namespace Facepunch.Steamworks.Interop
FillInterfaces( steamworks, hUser, hPipe );
if ( !user.IsValid )
return false;
// Ensure that the user has logged into Steam. This will always return true if the game is launched
// from Steam, but if Steam is at the login prompt when you run your game it will return false.
if ( !user.BLoggedOn() )

View File

@ -19,7 +19,7 @@ namespace Generator
StartBlock( $"internal class {type} : Interface" );
{
WriteLine( "internal IntPtr _ptr;" );
WriteLine( "public bool IsValid { get{ return _ptr != null; } }" );
WriteLine( "public bool IsValid { get{ return _ptr != IntPtr.Zero; } }" );
WriteLine();
WriteLine( "//" );