fix: new ticket trhowing error

This commit is contained in:
canove
2020-08-04 13:34:25 -03:00
parent 5848359075
commit b464337a8a

View File

@@ -16,7 +16,7 @@ class Ticket extends Sequelize.Model {
);
this.addHook("afterFind", async result => {
if (result.length > 0) {
if (result && result.length > 0) {
await Promise.all(
result.map(async ticket => {
ticket.unreadMessages = await Message.count({