From 81988e075369f4e267606db3662bd15d7ec1a40e Mon Sep 17 00:00:00 2001 From: gerard Date: Fri, 29 Jun 2018 08:07:40 +0200 Subject: [PATCH] bug fixed --- services/loopback/common/methods/ticket/getSalesPersonMana.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/loopback/common/methods/ticket/getSalesPersonMana.js b/services/loopback/common/methods/ticket/getSalesPersonMana.js index 9b252852a..1289374cd 100644 --- a/services/loopback/common/methods/ticket/getSalesPersonMana.js +++ b/services/loopback/common/methods/ticket/getSalesPersonMana.js @@ -33,6 +33,6 @@ module.exports = Self => { }); let mana = await Self.app.models.WorkerMana.findOne({where: {workerFk: ticket[0].client().salesPersonFk}, fields: 'amount'}); - return mana.amount | 0; + return mana ? mana.amount : 0; }; };