openai / openai-dotnet

The official .NET library for the OpenAI API
https://www.nuget.org/packages/OpenAI
MIT License
707 stars 60 forks source link

Fix NullReferenceException thrown in CreateAddCustomHeadersPolicy when OpenAIClientOptions is null #85

Closed joseharriaga closed 6 days ago

joseharriaga commented 1 week ago

This change adds a necessary null check to the CreateAddCustomHeadersPolicy method in the OpenAIClient for the cases when the OpenAIClientOptions argument is null.