diff --git a/OpenFlow/src/public/Controllers.ts b/OpenFlow/src/public/Controllers.ts index 2a6be748..3c3ce75b 100644 --- a/OpenFlow/src/public/Controllers.ts +++ b/OpenFlow/src/public/Controllers.ts @@ -7780,7 +7780,7 @@ export class AgentsCtrl extends entitiesCtrl { for (var i = 0; i < this.models.length; i++) { var model = this.models[i]; var user = await NoderedUtil.Query({ collectionname: "users", query: { _id: (model as any).runas }, top: 1 }); - if(user.length > 0) { + if(user != null && user.length > 0) { // @ts-ignore model.customerid = user[0].customerid; }