Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentException in SessionServerConverter #7

Closed
BabyDino opened this issue Aug 18, 2017 · 4 comments
Closed

ArgumentException in SessionServerConverter #7

BabyDino opened this issue Aug 18, 2017 · 4 comments
Assignees
Labels
Milestone

Comments

@BabyDino
Copy link

I'm fairly new to C# so please be gentle with me ;) I am creating an UWP app. I run into an exception in SessionServerConverter:29:

var jObjects = JArray.Load(reader).ToObject<List<JObject>>();

My code (IP masked):

IList<string> permittedIps = new List<string>();
permittedIps.Add("x.x.x.x");

var apiContext = ApiContext.Create(ApiEnvironmentType.SANDBOX, API_KEY, DEVICE_DESCRIPTION, permittedIps);
apiContext.Save("Config/bunq.conf");

Stacktrace:

  HResult=0x80070057
  Message=Arg_WrongType, [], Newtonsoft.Json.Linq.JObject
  Source=<unknown>
  StackTrace:
   at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item) in f:\dd\ndp\fxcore\src\System.Collections\System\Collections\Generic\List.cs:line 254
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType)
   at Bunq.Sdk.Json.SessionServerConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in C:\Users\BabyDino\Documents\GitHub\sdk_csharp\BunqSdk\Json\SessionServerConverter.cs:line 29
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)

bunq responses are OK (checked with profiler). The device will register without issue. Tried earlier versions of Newtonsoft.JSON as well. Seems to be a casting issue?

@OGKevin OGKevin added the bug label Aug 18, 2017
@OGKevin OGKevin added this to the v0.10.0 milestone Aug 18, 2017
@dnl-blkv
Copy link
Contributor

@BabyDino you're very right, it is a bug on our side. I have got a fix and will release it shortly. Thanks for reporting!

@OGKevin Let's make it a patch. Please tag as 0.9.2.

@OGKevin OGKevin modified the milestones: v0.10.0, Patch 0.9.2 Aug 18, 2017
dnl-blkv added a commit that referenced this issue Aug 18, 2017
OGKevin added a commit that referenced this issue Aug 18, 2017
Fix SessionServerConverter, bump up to 0.9.2.0-beta [#7]
@OGKevin
Copy link
Contributor

OGKevin commented Aug 18, 2017

@BabyDino FYI

@OGKevin OGKevin closed this as completed Aug 18, 2017
@dnl-blkv
Copy link
Contributor

@BabyDino Please check https://www.nuget.org/packages/Bunq.Sdk/0.9.2-beta

Feel free to poke us if it breaks somewhere :)

@BabyDino
Copy link
Author

Ahwww yessss!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants