dsuryd / dotNetify

Simple, lightweight, yet powerful way to build real-time web apps.
https://dotnetify.net
Other
1.17k stars 164 forks source link

DotnetifyHub NormalizeType -- Possible Invalid if condition #239

Closed treg closed 4 years ago

treg commented 4 years ago

I think line # 289 should be an && not || Currently: else if (!(data.GetType().IsPrimitive || data is string))

Reproduce: From Client call Action AddUser = data => {} Server Error: Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher: Error: Failed to invoke hub method 'Update_VM'.

Newtonsoft.Json.JsonReaderException: Error reading JObject from JsonReader. Current JsonReader item is not an object: String. Path '', line 1, position 20. at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings) at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings) at Newtonsoft.Json.Linq.JObject.Parse(String json) at DotNetify.DotNetifyHub.NormalizeType(Object data)

dsuryd commented 4 years ago

Thank you for reporting the bug. The error isn't from line #289, but line #285. It'll be fixed in the next release.

dsuryd commented 4 years ago

Fixed in v3.7.