[CSharpBinding] Fixed potential null reference exception.