diff --git a/Generator/CodeWriter/Class.cs b/Generator/CodeWriter/Class.cs index 1077a63..1c0790f 100644 --- a/Generator/CodeWriter/Class.cs +++ b/Generator/CodeWriter/Class.cs @@ -430,7 +430,8 @@ private void Detect_InterfaceReturn( List argList, List call ReturnVar = "interface_pointer"; ReturnType = ReturnType.Substring( 1 ).Trim( '*', ' ' ); - AfterLines.Add( $"return new {ReturnType}( steamworks, interface_pointer );" ); + AfterLines.Add( $"if ( interface_pointer == IntPtr.Zero ) throw new System.Exception( $\"Error getting interface {{pchVersion}}\");" ); + AfterLines.Add( $"return new {ReturnType}( steamworks, interface_pointer );" ); } private void Detect_VectorReturn( List argList, List callArgs )