TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
John Riker
NA
85
16.1k
JSON Feed an no values
Nov 29 2020 5:03 PM
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
So I read in the data:
rawJSON = webClient.DownloadString(showsurls);
ShowWebsiteDownloader.Rootobject rootObject = JsonConvert.DeserializeObject<ShowWebsiteDownloader.Rootobject>(rawJSON);
Then process the results
for
(
int
loop = 0; loop < rootObject.tiles.Length; loop++)
{
So the before mentioned error is on the start of the for loop. Is there a way to check if any data exists after Deserializing?
Reply
Answers (
4
)
Please explain Linq Group Join in simple terms.
Button on click on dataTable is not firing.