sequelize/sequelize — pull request #1017 by leahciMic (2013-10-27 10:46:04+00:00)
Title: Fixes error thrown when eager loading a hasMany relationship that has zero models

When a hasMany association is eagerly loaded, and there is 0 related models in the datastore, this gets thrown:

```
>> TypeError: Cannot read property 'associationType' of null
>> at null. (/Users/michael/Projects/dearharry-server/node_modules/sequelize/lib/dialects/abstract/query.js:331:54)
>> at Array.forEach (native)
>> at module.exports.buildAssociatedDaoInstances (/Users/michael/Projects/dearharry-server/node_modules/sequelize/lib/dialects/abstract/query.js:327:21)
>> at module.exports.transformRowWithEagerLoadingIntoDao (/Users/michael/Projects/dearharry-server/node_modules/sequelize/lib/dialects/abstract/query.js:296:37)
>> at null. (/Users/michael/Projects/dearharry-server/node_modules/sequelize/lib/dialects/abstract/query.js:282:50)
>> at Array.map (native)
>> at module.exports.transformRowsWithEagerLoadingIntoDaos (/Users/michael/Projects/dearharry-server/node_modules/sequelize/lib/dialects/abstract/query.js:281:58)
>> at module.exports.handleSelectQuery (/Users/michael/Projects/dearharry-server/node_modules/sequelize/lib/dialects/abstract/query.js:262:54)
>> at module.exports.AbstractQuery.formatResults (/Users/michael/Projects/dearharry-server/node_modules/sequelize/lib/dialects/abstract/query.js:68:34)
>> at null. (/Users/michael/Projects/dearharry-server/node_modules/sequelize/lib/dialects/mysql/query.js:32:35)
```

This inserts a check to see if the association is null, and returns early.