question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error converting value {null} to type 'System.Int32'. Path 'retweeted_status.favorite_count',

See original GitHub issue

Hi,

I’ve just noticed the following error on my server (running tweetinvi code for several months now):

Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.Int32'. Path 'retweeted_status.favorite_count', line 1, position 3809. ---> 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.Serialization.JsonSerializerProxy.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader) at Tweetinvi.Logic.JsonConverters.JsonInterfaceToObjectConverter2.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) at Tweetinvi.Logic.JsonConverters.JsonPropertyConverterRepository.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, 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.Serialization.JsonSerializerProxy.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader) at Tweetinvi.Logic.JsonConverters.JsonInterfaceToObjectConverter2.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) 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) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonConverter[] converters) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonConverter[] converters) at Tweetinvi.Logic.Wrapper.JsonConvertWrapper.DeserializeObject[T](String json, JsonConverter[] converters) at Tweetinvi.Logic.JsonConverters.JsonObjectConverter.DeserializeObject[T](String json, JsonConverter[] converters) at Tweetinvi.Factories.Tweet.TweetFactory.GenerateTweetFromJson(String jsonTweet) at Tweetinvi.Streams.FilteredStream.<StartStreamMatchingAnyConditionAsync>b__16_1(String json) at Tweetinvi.Streams.Helpers.StreamResultGenerator.<>c__DisplayClass20_0.<StartStreamAsync>b__0(String json) at Tweetinvi.Streams.StreamTask.Start()

Do you know what happens there?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
linvicommented, Jan 18, 2017

A temporary fix has just been released on nuget. Please update the library to 1.2.0.1 to fix this issue.

0reactions
linvicommented, Jan 20, 2017

With no other person with this problem, I am now closing it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Newtonsoft Json Error converting value {null} to type ' ...
When performing an AJAX request I am getting the following error: Error converting value {null} to type 'System.Int32'. Path '[5].
Read more >
C# – Newtonsoft Json Error converting value {null} to type ' ...
When performing an AJAX request I am getting the following error: Error converting value {null} to type 'System.Int32'. Path '[5].tabID', line 1, position...
Read more >
Solved: Expression.Error: We cannot convert the value null...
The error "Expression. Error: We cannot convert the value null to type Number" happened already in earlier steps. For some reason it got...
Read more >
Error converting value {null} to type 'System.Single'. - Solved ...
Error as described in title, occurs when loading profile data (profile transferred from SPT-AKI 1.5.1) after launching the game.
Read more >
Newtonsoft Json Error converting value {null} to type 'System ...
Coding example for the question Newtonsoft Json Error converting value {null} to type 'System.Int32'-C#.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found