sendinblue / APIv3-csharp-library

SendinBlue's C# library for API v3
MIT License
58 stars 26 forks source link

NullReferenceException when call SendTransacEmail #54

Closed bahs closed 1 year ago

bahs commented 2 years ago

The code that worked for couple of years started to generate NullReferenceException when we call SendTransacEmail method to send transactional email. Nothing was changed on our side. Upgrading to the last version of library(3.3.0) didn't helped. Our environment is .NET 5, Azure.

Here's the call stack System.NullReferenceException: at RestSharp.Portable.ParameterKeyComparer.Compare (FubarCoder.RestSharp.Portable.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=be81bb0f53eab22f) at RestSharp.Portable.ParameterKeyComparer.Equals (FubarCoder.RestSharp.Portable.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=be81bb0f53eab22f) at System.Collections.Generic.Dictionary2.FindValue (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) at System.Collections.Generic.Dictionary2.TryGetValue (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) at RestSharp.Portable.MultiValueDictionary`2.TryGetValue (FubarCoder.RestSharp.Portable.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=be81bb0f53eab22f) at RestSharp.Portable.ParameterCollection.AddOrUpdate (FubarCoder.RestSharp.Portable.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=be81bb0f53eab22f) at RestSharp.Portable.RestClientBase.set_UserAgent (FubarCoder.RestSharp.Portable.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=be81bb0f53eab22f) at sib_api_v3_sdk.Client.ApiClient.CallApi (sib_api_v3_sdk, Version=3.3.0.0, Culture=neutral, PublicKeyToken=null) at sib_api_v3_sdk.Api.TransactionalEmailsApi.SendTransacEmailWithHttpInfo (sib_api_v3_sdk, Version=3.3.0.0, Culture=neutral, PublicKeyToken=null) at RT.Utils.SendInBlueService.SendEmailMessage (RT, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: D:\home\site\repository\RT\Utils\SendInBlueService.cs:848)

bahs commented 2 years ago

If we restart the server - everything works good for about 1 day, after that we get this exception again.

amitsendinblue commented 1 year ago

Not able to replicate the issue at our end, kindly kindly refer the latest version v4.0.2 and let us know if you still face any issue.