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

Fix errors when From is null in telemetry #3436

Merged
merged 2 commits into from
Feb 25, 2020
Merged

Fix errors when From is null in telemetry #3436

merged 2 commits into from
Feb 25, 2020

Conversation

mdrichardson
Copy link
Contributor

Fixes: #3395

If TelemetryLoggerMiddleware is used and then CreateConversationAsync() is called, there are cases where Activity.From will be null, which causes things like this to throw:

{ TelemetryConstants.FromIdProperty, activity.From.Id },

Changes:

Adds a few null-conditional operators, where appropriate.

Testing:

Added one test which calls CreateConversationAsync() while ensuring the Activity.From is null.

@mdrichardson mdrichardson changed the title Fx null From in telemetry Fix errors when From is null in telemetry Feb 25, 2020
Copy link
Contributor

@tomlm tomlm left a comment

Choose a reason for hiding this comment

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

:shipit:

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.

Microsoft Teams: Bot Framework + Application Insights with CreateConversationAsync causes null exception?
2 participants