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,6 +430,7 @@ private void Detect_InterfaceReturn( List<Argument> argList, List<Argument> call
ReturnVar = "interface_pointer";
ReturnType = ReturnType.Substring( 1 ).Trim( '*', ' ' );
AfterLines.Add( $"if ( interface_pointer == IntPtr.Zero ) throw new System.Exception( $\"Error getting interface {{pchVersion}}\");" );
AfterLines.Add( $"return new {ReturnType}( steamworks, interface_pointer );" );
}