From fdf1957ac1f991870e52476b7f1e19114ca8daa9 Mon Sep 17 00:00:00 2001 From: Alexander Sher Date: Tue, 22 Oct 2019 18:36:09 -0500 Subject: [PATCH] Fix #8334: Throw ArgumentNullException if SettingSelector passed in to GetSettings is null. --- .../Azure.Data.AppConfiguration/src/ConfigurationClient.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs index 3019f16ae2f1..4fc46b249f16 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs @@ -626,6 +626,7 @@ internal virtual Response Get(string key, string label, Da /// A controlling the request lifetime. public virtual AsyncPageable GetSettingsAsync(SettingSelector selector, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(selector, nameof(selector)); return PageResponseEnumerator.CreateAsyncEnumerable(nextLink => GetSettingsPageAsync(selector, nextLink, cancellationToken)); } @@ -636,6 +637,7 @@ public virtual AsyncPageable GetSettingsAsync(SettingSelec /// A controlling the request lifetime. public virtual Pageable GetSettings(SettingSelector selector, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(selector, nameof(selector)); return PageResponseEnumerator.CreateEnumerable(nextLink => GetSettingsPage(selector, nextLink, cancellationToken)); } @@ -646,6 +648,7 @@ public virtual Pageable GetSettings(SettingSelector select /// A controlling the request lifetime. public virtual AsyncPageable GetRevisionsAsync(SettingSelector selector, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(selector, nameof(selector)); return PageResponseEnumerator.CreateAsyncEnumerable(nextLink => GetRevisionsPageAsync(selector, nextLink, cancellationToken)); } @@ -656,6 +659,7 @@ public virtual AsyncPageable GetRevisionsAsync(SettingSele /// A controlling the request lifetime. public virtual Pageable GetRevisions(SettingSelector selector, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(selector, nameof(selector)); return PageResponseEnumerator.CreateEnumerable(nextLink => GetRevisionsPage(selector, nextLink, cancellationToken)); }