Joma Alrzini

Joma Alrzini

  • NA
  • 21
  • 1.9k

NullReferences Exception

Oct 16 2019 6:42 AM
I got this error when I tried to run the good which gives and object reference not to an instance of an object
 
this is the code
  1. string responseString = reader.ReadToEnd();  
  2. dynamic jsonData = JsonConvert.DeserializeObject(responseString);  
  3. var results = new List<Result>();  
  4. foreach (var item in jsonData.items)  
  5. {  
  6. results.Add(new Result  
  7. {  
  8. Title = item.title,  
  9. Link = item.link,  
  10. Snippet = item.snippet,  
  11. });  
  12. }  
please kindly help

Answers (5)