diff --git a/dist/index.js b/dist/index.js index 6b7de10..d2e0e14 100644 --- a/dist/index.js +++ b/dist/index.js @@ -243,7 +243,7 @@ var jsLogger = /*#__PURE__*/function () { pending_logs = this.logs; } - if (pending_logs.length === 0) { + if (!pending_logs || pending_logs === 0) { this.isAjaxCompleted = true; this.endCheck(); return; diff --git a/src/index.js b/src/index.js index bc10bde..041a6b0 100644 --- a/src/index.js +++ b/src/index.js @@ -209,7 +209,7 @@ class jsLogger { pending_logs = this.logs; } - if (pending_logs.length === 0) { + if (!pending_logs || pending_logs === 0) { this.isAjaxCompleted = true; this.endCheck(); return;