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

Error converting value {null} to type 'System.Double'. Path 'popularity' #418

Closed
TheUltimateC0der opened this issue Oct 13, 2022 · 0 comments · Fixed by #419
Closed

Error converting value {null} to type 'System.Double'. Path 'popularity' #418

TheUltimateC0der opened this issue Oct 13, 2022 · 0 comments · Fixed by #419

Comments

@TheUltimateC0der
Copy link
Contributor

Some movies seem to have null as value for popularity

Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.Double'. Path 'popularity', line 1, position 210.
       ---> System.InvalidCastException: Null object cannot be converted to a value type.
         at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
         at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
         --- End of inner exception stack trace ---
         at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
         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.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
         at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
         at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
         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 TMDbLib.Utilities.Serializer.TMDbJsonSerializer.Deserialize(Stream source, Type type)
         at TMDbLib.Utilities.Serializer.SerializerExtensions.Deserialize[T](ITMDbSerializer serializer, Stream source)
         at TMDbLib.Rest.RestResponse`1.GetDataObject()
         at TMDbLib.Client.TMDbClient.GetMovieAsync(String imdbId, String language, String includeImageLanguage, MovieMethods extraMethods, CancellationToken cancellationToken)
         at TMDbLib.Client.TMDbClient.GetMovieAsync(Int32 movieId, String language, String includeImageLanguage, MovieMethods extraMethods, CancellationToken cancellationToken)
         at TMDbLib.Client.TMDbClient.GetMovieAsync(Int32 movieId, MovieMethods extraMethods, CancellationToken cancellationToken)
         at REDACTED.<>c__DisplayClass8_0.<<Execute>b__2>d.MoveNext() in REDACTED:line 130
TheUltimateC0der pushed a commit to TheUltimateC0der/TMDbLib that referenced this issue Oct 13, 2022
LordMike added a commit that referenced this issue Jan 7, 2023
…g_value_null_to_type_System.Double_._Path_popularity

double Popularity for Movie model is now nullable to combat #418
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant