Skip to content

Commit 69d0962

Browse files
authored
Merge pull request #219 from intuit/IPP-18980
IPP-18980 Update null pointer exception for environment
2 parents 5b4edc6 + fe97d0c commit 69d0962

File tree

1 file changed

+3
-2
lines changed
  • IPPDotNetDevKitCSV3/Code/Intuit.Ipp.OAuth2PlatformClient/Client

1 file changed

+3
-2
lines changed

IPPDotNetDevKitCSV3/Code/Intuit.Ipp.OAuth2PlatformClient/Client/OAuth2Client.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ public OAuth2Client(string clientID, string clientSecret, string redirectURI, st
171171
ClientID = clientID ?? throw new ArgumentNullException(nameof(clientID));
172172
ClientSecret = clientSecret ?? throw new ArgumentNullException(nameof(clientSecret));
173173
RedirectURI = redirectURI ?? throw new ArgumentNullException(nameof(redirectURI));
174-
if (environment != null && environment != "")
174+
environment = environment ?? throw new ArgumentNullException(nameof(environment));
175+
if (environment != "")
175176
{
176177
try
177178
{
@@ -250,7 +251,7 @@ public DiscoveryResponse GetDiscoveryDoc()
250251
DiscoveryResponse discoveryResponse = discoveryClient.Get();
251252
if(discoveryResponse.IsError==true)
252253
{
253-
throw new System.Exception(discoveryResponse.Error);
254+
throw new System.Exception("Invalid URI or environment");
254255
}
255256

256257
return discoveryResponse;

0 commit comments

Comments
 (0)