From 0c4adeed822bbbb5640ea66f1f91d7db87b77c64 Mon Sep 17 00:00:00 2001 From: pvan-canada <60486014+pvan-canada@users.noreply.github.com> Date: Wed, 20 May 2020 14:19:34 -0400 Subject: [PATCH 1/2] Null Argument Exception #665 --- Box.V2/Managers/BoxResourceManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Box.V2/Managers/BoxResourceManager.cs b/Box.V2/Managers/BoxResourceManager.cs index 717a36871..bd9482379 100644 --- a/Box.V2/Managers/BoxResourceManager.cs +++ b/Box.V2/Managers/BoxResourceManager.cs @@ -154,7 +154,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; From 6e8a2d02da4d35c54fcbabc67b92536407815bb8 Mon Sep 17 00:00:00 2001 From: pvan-canada <60486014+pvan-canada@users.noreply.github.com> Date: Wed, 20 May 2020 14:26:23 -0400 Subject: [PATCH 2/2] Null Argument Exception #665 Fix all of them (Use C# 7 convention) --- 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 bd9482379..104624360 100644 --- a/Box.V2/Managers/BoxResourceManager.cs +++ b/Box.V2/Managers/BoxResourceManager.cs @@ -154,7 +154,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 ??= new List()); + allItemsCollection.Entries.AddRange(newItems.Entries ?? new List()); allItemsCollection.Order = newItems.Order; offset += limit; @@ -186,7 +186,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); @@ -215,7 +215,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); @@ -243,7 +243,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);