Skip to content

Commit

Permalink
fix: Null Argument Exception in AutoPaginate (#666)
Browse files Browse the repository at this point in the history
Co-authored-by: pvan-canada <60486014+pvan-canada@users.noreply.github.com>
Co-authored-by: Sujay Garlanka <sujay.garlanka@gmail.com>
Co-authored-by: Mateusz Woda <mwoda@box.com>
  • Loading branch information
4 people committed Jan 5, 2022
1 parent 55a706e commit c61f08c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Box.V2/Managers/BoxResourceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ protected async Task<BoxCollection<T>> AutoPaginateLimitOffset<T>(BoxRequest req
{
var response = await ToResponseAsync<BoxCollection<T>>(request).ConfigureAwait(false);
var newItems = response.ResponseObject;
allItemsCollection.Entries.AddRange(newItems.Entries);
allItemsCollection.Entries.AddRange(newItems.Entries ?? new List<T>());
allItemsCollection.Order = newItems.Order;

offset += limit;
Expand Down Expand Up @@ -189,7 +189,7 @@ protected async Task<BoxCollectionMarkerBased<T>> AutoPaginateMarker<T>(BoxReque
{
var response = await ToResponseAsync<BoxCollectionMarkerBased<T>>(request).ConfigureAwait(false);
var newItems = response.ResponseObject;
allItemsCollection.Entries.AddRange(newItems.Entries);
allItemsCollection.Entries.AddRange(newItems.Entries ?? new List<T>());
allItemsCollection.Order = newItems.Order;

request.Param("marker", newItems.NextMarker);
Expand Down Expand Up @@ -220,7 +220,7 @@ protected async Task<BoxCollectionMarkerBasedV2<T>> AutoPaginateMarkerV2<T>(BoxR
{
var response = await ToResponseAsync<BoxCollectionMarkerBasedV2<T>>(request).ConfigureAwait(false);
var newItems = response.ResponseObject;
allItemsCollection.Entries.AddRange(newItems.Entries);
allItemsCollection.Entries.AddRange(newItems.Entries ?? new List<T>());
allItemsCollection.Order = newItems.Order;

request.Param("marker", newItems.NextMarker);
Expand Down Expand Up @@ -282,7 +282,7 @@ protected async Task<BoxCollectionMarkerBased<T>> AutoPaginateMarkerMetadataQuer
{
var response = await ToResponseAsync<BoxCollectionMarkerBased<T>>(request).ConfigureAwait(false);
var newItems = response.ResponseObject;
allItemsCollection.Entries.AddRange(newItems.Entries);
allItemsCollection.Entries.AddRange(newItems.Entries ?? new List<T>());
allItemsCollection.Order = newItems.Order;

dynamic body = JObject.Parse(request.Payload);
Expand Down

0 comments on commit c61f08c

Please sign in to comment.