3Squared / SQKDataKit

Lightweight Core Data helper to reduce boilerplate code.
MIT License
19 stars 6 forks source link

Adds check to see if dictionary array passed to sqk_insertOrUpdate is valid #47

Closed zilmarinen closed 9 years ago

zilmarinen commented 9 years ago

Includes a check to see if dictionary array is valid before attempting to filter nil or empty array.

blork commented 9 years ago

Hard to decide whether this belongs in or not. It's tempting to just allow the invalid value since it makes calling code nicer to read, but I feel like it should probably crash if called with nil, just as if an app would crash if you tried to insert nil into an array.

It's similar in a way, since in both you are attempting to insert data. The precedent is set by Foundation, so for now, not going to merge.

You could always make you're own method that wraps sqk_insertOrUpdate and does the check.