diff --git a/src/change_stream.ts b/src/change_stream.ts index ed847519e8..a4718efc93 100644 --- a/src/change_stream.ts +++ b/src/change_stream.ts @@ -809,7 +809,14 @@ export class ChangeStream< while (true) { try { const change = await this.cursor.tryNext(); - return change ?? null; + + // Prevent _processChange from producing an error due to a `null` change + if (!change) { + return null; + } + + const processedChange = this._processChange(change); + return processedChange; } catch (error) { try { await this._processErrorIteratorMode(error, this.cursor.id != null);