Explorar o código

fix null array

asmer@hetzner %!s(int64=4) %!d(string=hai) anos
pai
achega
55daabf362
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/front-models.js

+ 1 - 1
src/front-models.js

@@ -144,7 +144,7 @@ export default async function createModels2(gql, config={create: 'Upsert', updat
                         LIST(){
                             this[name] = []
                             const otherType = inTypes(ofType.name)
-                            if (otherType  && 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))
                             else if (data && typeof data === 'object' && name in data) this[name] = data[name] || []
                         },