diff --git a/Facepunch.Steamworks/Interop/Native.cs b/Facepunch.Steamworks/Interop/Native.cs index 8cd5d5a..c59902f 100644 --- a/Facepunch.Steamworks/Interop/Native.cs +++ b/Facepunch.Steamworks/Interop/Native.cs @@ -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() ) diff --git a/Generator/CodeWriter/PlatformClass.cs b/Generator/CodeWriter/PlatformClass.cs index 14473ad..2409263 100644 --- a/Generator/CodeWriter/PlatformClass.cs +++ b/Generator/CodeWriter/PlatformClass.cs @@ -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( "//" );