diff --git a/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchResponse.cs b/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchResponse.cs index fdfd40f338..8cb9811121 100644 --- a/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchResponse.cs +++ b/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchResponse.cs @@ -394,12 +394,22 @@ private static async Task PopulateFromContentAsync( internal int GetBatchSize() { + if (this.Operations == null) + { + return 0; + } return this.Operations.Count; } internal OperationType? GetBatchOperationName() { HashSet operationNames = new (); + + if (this.Operations == null) + { + return null; + } + foreach (ItemBatchOperation operation in this.Operations) { operationNames.Add(operation.OperationType);