mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 15:44:59 +00:00
Merge pull request #2201 from greatwitenorth/patch-3
Fixes Cannot read property 'toJSON' of null
This commit is contained in:
commit
39ac9ec95a
@ -184,7 +184,7 @@ module.exports = {
|
||||
withRelated: populate || this.associations.map(x => x.alias)
|
||||
});
|
||||
|
||||
const data = record.toJSON ? record.toJSON() : record;
|
||||
const data = _.get(record, 'toJSON()', record);
|
||||
|
||||
// Retrieve data manually.
|
||||
if (_.isEmpty(populate)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user