Check against `null` and `undefined`
Merge pull request #848 from bradfol/hasmany

Bug fix: hasMany loaded as null is throwing exception