소스 검색

null in list fix

Ivan Asmer 4 년 전
부모
커밋
478b5895fd
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/front-models.js

+ 2 - 1
src/front-models.js

@@ -144,8 +144,9 @@ export default async function createModels2(gql, config={create: 'Upsert', updat
                         LIST(){
                             this[name] = []
                             const otherType = inTypes(ofType.name)
+                            console.log(data, name)
                             if (otherType && data && data[name])
-                                this[name] = data[name].map(otherEntity => new classes[otherType.name](otherEntity, otherEntity._id && Object.keys(otherEntity).length === 1))
+                                this[name] = data[name].map(otherEntity => otherEntity && (new classes[otherType.name](otherEntity, otherEntity._id && Object.keys(otherEntity).length === 1)))
                             else if (data && typeof data === 'object' && name in data) this[name] = data[name] || []
                         },
                         OBJECT(){