You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for reporting this - as far as I know this is indeed a bug and the SendGridClient should throw an ArgumentNullException if the apiKey parameter is omitted.
The constructor in question delegates to the SendGridClient(HttpClient httpClient, SendGridClientOptions options) ctor, which does check for options to be non-null, but not any of its members.
Definitely something that should be fixed in my opinion.
SendGridClient accepting null or empty ApiKey values
Create a new SendGridClient with the below code snippet.
Steps to Reproduce
The client gets created and proceeds for further execution on both the above pieces of code.
Expected Behavior :
Exception must be thrown if the key is null or empty.
Technical details:
One of my collegue tried this from a FunctionApp as well, this occurs there as well. I guess since there's no validation applied on the apiKey param.
The text was updated successfully, but these errors were encountered: