marcoarment / FCModel

An alternative to Core Data for people who like having direct SQL access.
MIT License
1.65k stars 173 forks source link

Fix for: 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderSet... #85

Closed rustyshelf closed 10 years ago

rustyshelf commented 10 years ago

... initWithObjects:count:]: attempt to insert nil object from objects[0]'

The code above this appears to be doing nil checking of instance, whereas this code doesn't, and crashes when instance is nil. I sent it out to our beta testers and already had 22 crashes in an hour so it's definitely a real issue ;)

I'm not familiar enough with FCModel to know if you need to move some of the code above into a common method and use it in both cases or not, but this doesn't appear to be the case?

rustyshelf commented 10 years ago

Also probably didn't need to create a Mutable set in this case, so feel free to change that if you need to.

marcoarment commented 10 years ago

Nice catch, thanks. I fixed it slightly differently to keep the guarantee set in the "documentation" (the .h comments) for FCModelInstanceSetKey.