Skip to content

Conversation

@khaledannajar
Copy link

When a wrong value "null" is set to a primitive attribute in the JSON and the DCAttributeSetter try to assign it to the attribute a crash is thrown

Here in this sample JSON book_id in int type and is set to null here I get the crash saying something like that " setNilValueForKey]: could not set nil as the value for the key _book_id.' ":

I fixed it by simply setting @0 to this special case.

{
"name": "andro",
"avatar": "http://url/userimage.jpg",
"summary": "pla pla pla ",
"book_id": null,
"datetime": 1455714077
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant