If a hasMany relationship is loaded as null, don't throw Adapter is either null or does not implement 'findHasMany' method. I have written some failing tests for this situation. I also committed a proposed fix, but not sure if it is the right approach.
Adapter is either null or does not implement 'findHasMany' method
Change introduced at this commit 81e6fde for these files:
Improved fix to use not equal null, because undefined == null. Better than using strict not equal against undefined, based on this info.
undefined == null
I think this is a good fix, but can we bring this up-to-date with the recent reference changes?
@tomdale thanks for taking a look. I have updated my commits to reflect the recent changes.
@bradfol It seems like the same as #936, with the patch :). Perhaps it would be usefull to add a test against undefined
@tomdale If this one is merged, then you could close the other one as well ;)
Why are we checking for false?
@tomdale I have removed the check for false. (Was patched to deal with an API that returned false for empty relationships, but I see that is not the correct API behavior.)
@sly7-7 Also added a test for undefined which is already passing.
@bradfol Thank you, I will close my PR. I think @tomdale will merge this one if you squash the commits.
Check against `null` and `undefined`
I have squashed the commits, thanks @sly7-7 @tomdale
@stefanpenner could we get this merged in?
@stefanpenner Thank you!
great, thanks @bradfol @stefanpenner