Skip to content

Commit

Permalink
Merge pull request #26 from joshnies-marketspark/fix/resolve-null
Browse files Browse the repository at this point in the history
Fix resolveEntity to allow null attributes
  • Loading branch information
Gery Hirschfeld authored Mar 25, 2020
2 parents 3ec18a3 + 8ff9367 commit 4524b69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/entity-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ export class EntityFactory<Entity, Settings> {
for (const attribute in entity) {
if (entity.hasOwnProperty(attribute)) {
if (isPromiseLike(entity[attribute])) {
entity[attribute] = await entity[attribute]
entity[attribute] = entity[attribute]
}

if (typeof entity[attribute] === 'object' && !(entity[attribute] instanceof Date)) {
if (entity[attribute] && typeof entity[attribute] === 'object' && !(entity[attribute] instanceof Date)) {
const subEntityFactory = entity[attribute]
try {
if (typeof (subEntityFactory as any).make === 'function') {
Expand Down

0 comments on commit 4524b69

Please sign in to comment.