Skip to content

Conversation

facultymatt
Copy link
Contributor

This PR fixes an issue that happens when using nested schema.

We check that rule exists AND is not async.

I was not sure how to test this, so no tests are included. I only encountered this issue when using schema with js-data and js-data angular.

@jmdobry
Copy link
Member

jmdobry commented Apr 7, 2015

It's good to add this check, but I'm wondering why a rule would be undefined. Can you post here your schema definition that's causing the error. Or better yet, and plunker that demonstrates the issue? Here's one you can work from: http://plnkr.co/edit/LV6c0Y?p=info

@jmdobry jmdobry added the bug label Apr 7, 2015
@facultymatt
Copy link
Contributor Author

http://plnkr.co/edit/i8G2JF?p=preview

See console for TypeError: Cannot read property 'async' of undefined

@jmdobry
Copy link
Member

jmdobry commented Apr 7, 2015

I'm investigating, I think there's a deeper bug here.

@jmdobry
Copy link
Member

jmdobry commented Apr 7, 2015

Yes, it turns out there was a deeper issue, requiring a different fix. I still think it's good to add these checks, so I'll merge your PR and then make the other fix.

jmdobry added a commit that referenced this pull request Apr 7, 2015
Check for instance wherel rule is undefined.
@jmdobry jmdobry merged commit 5042232 into js-data:master Apr 7, 2015
jmdobry added a commit that referenced this pull request Apr 7, 2015
@facultymatt
Copy link
Contributor Author

Awesome! Thanks for the quick fixes!

@jmdobry
Copy link
Member

jmdobry commented Apr 7, 2015

@facultymatt It's actually fixed in 1.2.3. 1.2.2 was missing one tiny piece.

@facultymatt facultymatt deleted the bugs/undefined-rule-check branch April 7, 2015 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants