Skip to content

Handle null httpClient in SimpleHttpProvider cstor [blocks Azure Functions for M.G] #70

@MIchaelMainer

Description

@MIchaelMainer

microsoftgraph/msgraph-sdk-dotnet#605

Expected behavior

Setting the first parameter to null in GraphServiceClient cstor shouldn't break clients that took a dependency on the cstor with a required authProvider and an optional and not specified second parameter.

Actual behavior

Setting the first parameter to null in GraphServiceClient cstor uses a newer cstor overload where the compiler makes a correct assumption that the overload with a single parameter is the one to be used. Essentially, the cstor with the first required and second optional overload, no makes the second optional parameter a required parameter.

So now, the cstor that takes an HttpClient is being used, which is causing unexpected behavior.

There is no idea of a default overload.

Steps to reproduce the behavior

Using 1.14.0 create GraphServiceClient(null) creates a GraphServiceClient with a null authProvider.
Using 1.15.0 create GraphServiceClient(null) creates a GraphServiceClient with a null HttpClient.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions