Throw error if interface_pointer is null

This commit is contained in:
Garry Newman 2019-04-11 21:38:06 +01:00
parent feec8f6842
commit d91ba6d84a

View File

@ -430,7 +430,8 @@ private void Detect_InterfaceReturn( List<Argument> argList, List<Argument> call
ReturnVar = "interface_pointer"; ReturnVar = "interface_pointer";
ReturnType = ReturnType.Substring( 1 ).Trim( '*', ' ' ); 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<Argument> argList, List<Argument> callArgs ) private void Detect_VectorReturn( List<Argument> argList, List<Argument> callArgs )