Skip to content

Commit

Permalink
Merge pull request #32 from dcodus/patch-1
Browse files Browse the repository at this point in the history
Validate `attributes`  in top-level member
  • Loading branch information
yury-dymov committed Jan 2, 2018
2 parents 3483004 + c2b8c0d commit a1cdf95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/redux-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ export default function build(reducer, objectName, id = null, providedOpts = {},
ret.id = target.id;
}

Object.keys(target.attributes).forEach((key) => { ret[key] = target.attributes[key]; });

if (target.attributes) {
Object.keys(target.attributes).forEach((key) => { ret[key] = target.attributes[key]; });
}

if (target.meta) {
ret.meta = target.meta;
}
Expand Down

0 comments on commit a1cdf95

Please sign in to comment.