Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CosmosClient Constructor: Fixes NullReferenceException when AzMetadata.Compute is null #3242

Merged
merged 3 commits into from
Jun 2, 2022

Conversation

imanvt
Copy link
Contributor

@imanvt imanvt commented Jun 2, 2022

Pull Request Template

Description

When AzMetadata.Compute is null for the VMMetadataApiHandler, the GetMachineId method does not work as intended. This PR fixes that to not allow a null reference to exist.

Type of change

  • [] Bug fix (non-breaking change which fixes an issue)

Closing issues

closes #3237

@imanvt imanvt requested a review from khdang as a code owner June 2, 2022 11:50
@imanvt imanvt linked an issue Jun 2, 2022 that may be closed by this pull request
j82w
j82w previously approved these changes Jun 2, 2022
Copy link
Member

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for using String.IsNullOrWhitespace instead

@imanvt imanvt dismissed stale reviews from FabianMeiswinkel and j82w via 563b6f7 June 2, 2022 12:24
@imanvt imanvt requested review from FabianMeiswinkel and j82w June 2, 2022 12:28
@j82w j82w changed the title Telemetry: Fixes VMMetadataApiHandler Null Reference when AzMetadata.Compute is null CosmosClient Constructor: Fixes NullReferenceException when AzMetadata.Compute is null Jun 2, 2022
@ealsur ealsur merged commit 7f17fe1 into master Jun 2, 2022
@ealsur ealsur deleted the users/imanvt/3237-az-metadata-compute-null branch June 2, 2022 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Telemetry: VM metadata throwing Null
4 participants