LinqV3 Null Coalescing operator with empty string expression results in "Cannot find serializer for null"

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Unknown
    • 2.17.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      When doing an aggregate containing a projection expression like:

      .Project(
          augmentedProductType => new ProductTypeSearchResult
          {
              IsExternalUrl = string.IsNullOrEmpty(augmentedProductType.ShopUrl ?? "")
          }
      

       
      An InvalidOperationException occurs with message "Cannot find serializer for null."

      This happens with string.Empty as well.

      Driver version 2.14.1

      How to Reproduce

      Steps to reproduce. If possible, please include a Short, Self Contained, Correct (Compilable), Example.

      Additional Background

      Please provide any additional background information that may be helpful in diagnosing the bug.

      This seems to occur in ConstantExpressionToAggregationExpressionTranslator when making the call to get the serializer.

              Assignee:
              Robert Stam
              Reporter:
              Rich Collette
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: