In a React app component which handles Facebook-like content feeds, I am running into an error:
Feed.js:94 undefined \"parsererror\" \"SyntaxError: Un
For me, this happened when one of the properties on the object I was returning as JSON threw an exception.
public Dictionary Clients { get; set; }
public int CRCount
{
get
{
var count = 0;
//throws when Clients is null
foreach (var c in Clients) {
count += c.Value;
}
return count;
}
}
Adding a null check, fixed it for me:
public Dictionary Clients { get; set; }
public int CRCount
{
get
{
var count = 0;
if (Clients != null) {
foreach (var c in Clients) {
count += c.Value;
}
}
return count;
}
}