From c61f08cc02d5c95ff71ef700e97393a0dc3dc890 Mon Sep 17 00:00:00 2001 From: Peter Vanleeuwen <60486014+peter-shinydocs@users.noreply.github.com> Date: Wed, 5 Jan 2022 10:43:14 -0500 Subject: [PATCH] fix: Null Argument Exception in AutoPaginate (#666) Co-authored-by: pvan-canada <60486014+pvan-canada@users.noreply.github.com> Co-authored-by: Sujay Garlanka Co-authored-by: Mateusz Woda --- Box.V2/Managers/BoxResourceManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Box.V2/Managers/BoxResourceManager.cs b/Box.V2/Managers/BoxResourceManager.cs index 062e2071e..5d2893ec4 100644 --- a/Box.V2/Managers/BoxResourceManager.cs +++ b/Box.V2/Managers/BoxResourceManager.cs @@ -155,7 +155,7 @@ protected void AddAuthorization(IBoxRequest request, string accessToken = null) { var response = await ToResponseAsync>(request).ConfigureAwait(false); var newItems = response.ResponseObject; - allItemsCollection.Entries.AddRange(newItems.Entries); + allItemsCollection.Entries.AddRange(newItems.Entries ?? new List()); allItemsCollection.Order = newItems.Order; offset += limit; @@ -189,7 +189,7 @@ protected void AddAuthorization(IBoxRequest request, string accessToken = null) { var response = await ToResponseAsync>(request).ConfigureAwait(false); var newItems = response.ResponseObject; - allItemsCollection.Entries.AddRange(newItems.Entries); + allItemsCollection.Entries.AddRange(newItems.Entries ?? new List()); allItemsCollection.Order = newItems.Order; request.Param("marker", newItems.NextMarker); @@ -220,7 +220,7 @@ protected void AddAuthorization(IBoxRequest request, string accessToken = null) { var response = await ToResponseAsync>(request).ConfigureAwait(false); var newItems = response.ResponseObject; - allItemsCollection.Entries.AddRange(newItems.Entries); + allItemsCollection.Entries.AddRange(newItems.Entries ?? new List()); allItemsCollection.Order = newItems.Order; request.Param("marker", newItems.NextMarker); @@ -282,7 +282,7 @@ protected void AddAuthorization(IBoxRequest request, string accessToken = null) { var response = await ToResponseAsync>(request).ConfigureAwait(false); var newItems = response.ResponseObject; - allItemsCollection.Entries.AddRange(newItems.Entries); + allItemsCollection.Entries.AddRange(newItems.Entries ?? new List()); allItemsCollection.Order = newItems.Order; dynamic body = JObject.Parse(request.Payload);