mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 03:39:29 +00:00
fix: new ticket trhowing error
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user