title: Json DeserializeObject exception: "reference not set to instance of an object"
body: <p>I'm having trouble deserializing a json string into objects. I have a similar instance working fine for a different class, but i can't seem to get this one to work correctly. Here is the class:</p>
  
  <pre><code>    class Task
  {
      public string ProviderID { get; set; }
      public string Id { get; set; }
      public string UserEmail { get; set; }
      public string Name { get; set; }
      public string Status { get; set; }
      public string CompleteBy { get; set; }
      public string CompleteAtLat { get; set; }
      public string CompleteAtLon { get; set; }
      public string PerformWithin { get; set; }
      public string AdditionalInfo { get; set; }
      public string UserCanReject { get; set; }
      public string StartTime { get; set; }
      public string CompleteTime { get; set; }
      public string ActualCompleteLat { get; set; }
      public string ActualCompleteLon { get; set; }
      public string UserNotes { get; set; }
  
  
  
      public static IList&lt;Task&gt; Get()
      {
          HttpWebRequest req = (HttpWebRequest)WebRequest.Create("url");
          req.Method = "GET";
          req.ContentType = "application/json";
          HttpWebResponse res = (HttpWebResponse)req.GetResponse();
          using (StreamReader sr = new StreamReader(res.GetResponseStream()))
          {
              string text = sr.ReadToEnd();
              JObject jsonresponse = JObject.Parse(text);
              Console.WriteLine(jsonresponse.ToString());
              IList&lt;JToken&gt; results = jsonresponse["Stasks"].Children().ToList();
              IList&lt;Task&gt; tasks = new List&lt;Task&gt;();
              foreach (JToken result in results)
              {
                  Task task = JsonConvert.DeserializeObject&lt;Task&gt;(result.ToString());
                  tasks.Add(task);
              }
              return tasks;
  
          }
      }
  </code></pre>
  
  <p>And here is a sample of the Json string i'm trying to deserialize.</p>
  
  <pre><code>    {
     "STasks":[
        {
           "ProviderId":"xxxxx",
           "Id":"xxxxx",
           "UserEmail":"xxxxx",
           "Name":"test",
           "Status":"Completed",
           "CompleteBy":"2014-11-15T15:17:00.0000000Z",
           "CompleteAtLat":0,
           "CompleteAtLon":0,
           "PerformWithin":50,
           "AdditionalInfo":"trsgghghfhghh",
           "UserCanReject":true,
           "STaskActivities":[
              {
                 "Instruction":"fsdgggdg",
                 "OutcomeId":"00000000000000000000000000000000",
                 "CompleteTime":"2014-11-14T15:19:37.0000000Z",
                 "ActivityType":"Instruction"
              }
           ],
           "STaskHistories":[
              {
                 "EventDate":"2014-11-14T15:18:27.2975697Z",
                 "Status":"Draft"
              },
              {
                 "EventDate":"2014-11-14T15:18:54.8263294Z",
                 "Status":"Sent"
              },
              {
                 "EventDate":"2014-11-14T15:19:37.7176027Z",
                 "Status":"Accepted"
              },
              {
                 "EventDate":"2014-11-14T15:19:49.0975573Z",
                 "Status":"Completed"
              }
           ],
           "StartTime":"2014-11-14T15:19:37.0000000Z",
           "CompleteTime":"2014-11-14T15:19:47.0000000Z",
           "ActualCompleteLat":52.6091012845814,
           "ActualCompleteLon":4.75544677437253,
           "UserNotes":"Fyujvhfdkskbvdskbdvsbkdsvhkj"
        }
     ]
  }
  </code></pre>
  
  <p>I couldn't find any sort of detailed explanation of how this method works exactly, so maybe i'm missing something here. If i don't have a property in my class but it does appear in the Json, then it should be ignored, right?</p>