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

Checking for NSNull references on relationship key paths. #28

Merged
merged 2 commits into from
Jul 6, 2013
Merged

Checking for NSNull references on relationship key paths. #28

merged 2 commits into from
Jul 6, 2013

Conversation

RCacheaux
Copy link
Contributor

No description provided.

@@ -281,7 +281,7 @@ - (id)relationshipObjectFromDictionary:(NSDictionary *)dictionary
for (NSString *keyPath in keyPaths) {
relationshipObject = [dictionary valueForKeyPath:keyPath];

if (relationshipObject) {
if (relationshipObject && relationshipObject != [NSNull null]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that lower down in this method there would still remain a chance that if the for loop exists after this iteration that you would still be returning null for the relationship object.

Do you want to add a check below that if it's null just return nil at the end?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about this?

… NSNULL reference in a relationship key path.
@cnstoll
Copy link
Contributor

cnstoll commented Jul 6, 2013

Nice

cnstoll added a commit that referenced this pull request Jul 6, 2013
Checking for NSNull references on relationship key paths.
@cnstoll cnstoll merged commit 7cfb7b8 into mutualmobile:master Jul 6, 2013
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