File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/apps/chatwoot/consumers/waha Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,9 @@ export class SessionStatusHandler {
6464 async handle ( data : WAHAWebhookSessionStatus ) {
6565 const payload = data . payload ;
6666 let text = '' ;
67- const current = payload . statuses . at ( - 1 ) ;
68- const previous = payload . statuses . at ( - 2 ) ;
69- const older = payload . statuses . at ( - 3 ) ;
67+ const current = payload . statuses ? .at ( - 1 ) ;
68+ const previous = payload . statuses ? .at ( - 2 ) ;
69+ const older = payload . statuses ? .at ( - 3 ) ;
7070 switch ( payload . status ) {
7171 case WAHASessionStatus . STARTING :
7272 // WORKING => STARTING [=> WORKING]
@@ -92,7 +92,7 @@ export class SessionStatusHandler {
9292 previous ?. status == WAHASessionStatus . STARTING &&
9393 older ?. status == WAHASessionStatus . WORKING
9494 ) {
95- if ( current . timestamp - previous . timestamp < RECOVER_TIME_MS ) {
95+ if ( current ? .timestamp - previous ? .timestamp < RECOVER_TIME_MS ) {
9696 // Session got recovered fast, no needs to notify about that
9797 return ;
9898 }
You can’t perform that action at this time.
0 commit comments