Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nil check objects before putting inside an array within CMStore #77

Merged
merged 4 commits into from
Jul 25, 2016

Conversation

apbendi
Copy link
Contributor

@apbendi apbendi commented Jul 14, 2016

Attempting to save a nil object or acl is now an (effective) no-op, instead of causing the app to crash.

Was seeing sporadic linker errors after upgrading to CocoaPods
1.0.1. A more aggressive refactoring of the Podfile to conform
to the 1.0+ syntax seems to have resolved the issues.
…: it should be a no-op that does not crash but currently throws an exception, per cloudmine#72
@@ -631,13 +631,21 @@ - (void)saveUserObject:(CMObject *)theObject additionalOptions:(CMStoreOptions *
}
return;
}

if (nil == theObject) {
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about logging a debug message in this case? Often a nil object is indicative of a CM response that was unexpected (perhaps a malformed search query, etc).

@marcweil marcweil self-assigned this Jul 19, 2016
@apbendi
Copy link
Contributor Author

apbendi commented Jul 25, 2016

@marcweil good idea; updated to add a log message in each case

@marcweil
Copy link
Contributor

Perfect. Looks good to me then! 👍

@marcweil marcweil assigned apbendi and unassigned marcweil Jul 25, 2016
@apbendi apbendi merged commit 3899ac8 into cloudmine:develop Jul 25, 2016
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.

2 participants