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
-
Joshua Vickery February 9th, 2009 @ 12:37 PM
- Milestone set to ObjectiveResource 1.01
looks like a nice fix
thanks Adam!
-
jjburka February 9th, 2009 @ 05:17 PM
- Assigned user set to jjburka
-
jjburka February 10th, 2009 @ 02:47 PM
- Assigned user changed from jjburka to Joshua Vickery
made a unit test , and hooked up google unit tests. I just set the default build action to run the unit tests.
-
Joshua Vickery February 10th, 2009 @ 04:17 PM
- Assigned user changed from Joshua Vickery to jjburka
I'm not seeing any changed on github: http://github.com/yfactorial/obj...
did you push them?
-
jjburka February 10th, 2009 @ 04:39 PM
i pushed it to the objectivesupport , I figured it would be better for the ticket to be closed before I updated OR
-
Joshua Vickery February 10th, 2009 @ 04:48 PM
- Assigned user changed from jjburka to Joshua Vickery
found it: http://github.com/yfactorial/obj...
I emailed Ryan to see if he can make the github/lighthouse integration work.
-
Joshua Vickery February 10th, 2009 @ 05:28 PM
- Assigned user changed from Joshua Vickery to jjburka
code looks good
I added some more tests and caught a bug:
http://github.com/yfactorial/obj...
http://github.com/yfactorial/obj...
-
Ryan Daigle February 10th, 2009 @ 07:42 PM
(from [e680d826b60e8923093d2f81a47c11b895c046c3]) [#37] fix format http://github.com/yfactorial/obj...
-
Ryan Daigle February 10th, 2009 @ 07:42 PM
(from [c4bd43c74e03150fbd3e361bc62c8432ccaf190f]) [#37] add testing of JSON, fix multi-word class name handling http://github.com/yfactorial/obj...
-
jjburka February 13th, 2009 @ 08:09 PM
- State changed from new to resolved
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.
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.
People watching this ticket
Referenced by
- 37 Crash when incoming JSON record has a null DateTime value (from [e680d826b60e8923093d2f81a47c11b895c046c3]) [#37] f...
- 37 Crash when incoming JSON record has a null DateTime value (from [c4bd43c74e03150fbd3e361bc62c8432ccaf190f]) [#37] a...