diff --git a/packages/nylas-sync/sync-worker.js b/packages/nylas-sync/sync-worker.js index d893ce764..ff23e4077 100644 --- a/packages/nylas-sync/sync-worker.js +++ b/packages/nylas-sync/sync-worker.js @@ -35,7 +35,9 @@ class SyncWorker { } closeConnection() { - this._conn.end(); + if (this._conn) { + this._conn.end(); + } this._conn = null }