Have a program that calls up a URL of JSON data and loads it in and then starts processing it record by record. That said, sometimes the result can be just a header with no data for various reasons. When I try to process the results I end up getting the below due to no data:
- Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
- at ShowWebsiteDownloader.Program.Main() in C:\Users\jriker\source\repos\ShowWebsiteDownloader\ShowWebsiteDownloader\Program.cs:line 97
- rawJSON = webClient.DownloadString(showsurls);
- ShowWebsiteDownloader.Rootobject rootObject = JsonConvert.DeserializeObject
(rawJSON);
Then process the results
- for (int loop = 0; loop < rootObject.tiles.Length; loop++)
- {

Sachin SinghRank #66 · 26.2K reputationPosted Nov 30, 2020, 11:35 PM EST
Rajanikant HawaldarRank #110 · 20.3K reputationPosted Nov 30, 2020, 11:37 PM EST
Jaimin ShethiyaRank #177 · 13.7K reputationPosted Dec 3, 2020, 6:46 PM EST
can you please tried the below code and checked.
Thanks
John Riker98 reputationPosted Dec 10, 2020, 5:32 AM EST