#37 ✓resolved
Adam Alexander

Crash when incoming JSON record has a null DateTime value

Reported by Adam Alexander | February 9th, 2009 @ 12:24 AM | in ObjectiveResource 1.01

Excellent project! I am really impressed so far and am finding ObjectiveResource very useful. I did run into one crash when using JSON format and retrieve records when one of those records has a null DateTime value. This is the relevant log entry:

2009-02-09 00:01:28.370 TestApp[1144:20b] <= [{"alert": {"name": "Hourly Test", "repeat": "Hourly", "id": 1, "user_id": 1, "next": "2009-02-09T01:00:00-05:00"}}, {"alert": {"name": "Test Nil Date", "repeat": "None", "id": 24, "user_id": 1, "next": null}}]

2009-02-09 00:01:28.374 TestApp[1144:20b] *** -[NSNull length]: unrecognized selector sent to instance 0xa028f020

2009-02-09 00:01:28.375 TestApp[1144:20b] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[NSNull length]: unrecognized selector sent to instance 0xa028f020'

This did not occur when using XML format. I came up with the following change which seems to resolve this and does not break any of your unit tests:

https://gist.github.com/69871546...

Thanks again for a very impressive project and I hope this is helpful.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Port of Rails' ActiveResource framework to the iPhone.

Shared Ticket Bins

People watching this ticket

Referenced by

Pages