Skip to content

[BUG] NullReferenceException when calling QueryWorkspaceAsync #49764

@junalmeida

Description

@junalmeida

Library name and version

Azure.Monitor.Query 1.6.0

Describe the bug

The call fails with NullReferenceException in case you have a column that might be present on some rows but not all rows.

Expected behavior

Leave the Property that is mapped to the result untouched if the column is missing.

Actual behavior

Exception has occurred: CLR/System.NullReferenceException
Exception thrown: 'System.NullReferenceException' in System.Private.CoreLib.dll: 'Object reference not set to an instance of an object.'
   at Azure.Monitor.Query.RowBinder.TryGet[T](BoundMemberInfo memberInfo, LogsTableRow source, T& value)
   at Azure.Core.TypeBinder`1.BoundMemberInfo`1.Deserialize(TExchange source, Object o, TypeBinder`1 binderImplementation)
   at Azure.Core.TypeBinder`1.BoundTypeInfo.Deserialize[T](TExchange source)
   at Azure.Monitor.Query.RowBinder.BindResults[T](IReadOnlyList`1 tables)
   at Azure.Monitor.Query.LogsQueryClient.<QueryWorkspaceAsync>d__14`1.MoveNext()

Reproduction Steps

  1. Create a table with a column in Azure Logs Workspace, or use some existing, like AppEvents of Application Insights.
  2. Ingest some records with data on the chosen column, and some records without it
  3. Query using QueryWorkspaceAsync

Environment

No response

Metadata

Metadata

Assignees

Labels

ClientThis issue is related to a non-management packageMonitor - Querycustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions