Blazor WebAssembly: changing between columns with restricted operators causes unhandled exception

Using 18.4.0.32

Issue:
When restricting the Operators property (see code below) of the query builder as suggested by the first answer here, the following exception occurs when changing the field of a condition to another field type after having selected an operator:
blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.Blazor.QueryBuilder.Internal.QueryBuilderValue`1[[XXXXX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].BuildRenderTree(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__6_0(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

Query builder component
            <SfQueryBuilder @ref="@queryBuilder" TValue="Person" EnablePersistence="true">
                <QueryBuilderShowButtons GroupInsert="false" GroupDelete="true" RuleDelete="true" />
                <QueryBuilderColumns>
                    <QueryBuilderColumn Field="@nameof(Person.FirstName)"
                                        Label="First Name"
                                        Type="ColumnType.String"
                                        Operators="startsWith" />
                    <QueryBuilderColumn Field="@nameof(Person.LastName)"
                                        Label="Last Name"
                                        Type="ColumnType.String"
                                        Operators="startsWith" />
                    <QueryBuilderColumn Field="@nameof(Person.Age)"
                                        Label="Age"
                                        Type="ColumnType.Number"
                                        Operators="between" />
                </QueryBuilderColumns>
            </SfQueryBuilder>

@code
{
    private List<OperatorsModel> equal = new List<OperatorsModel> {new OperatorsModel {Text = "Equals", Value = "equal"}};
    private List<OperatorsModel> startsWith = new List<OperatorsModel> {new OperatorsModel {Text = "Starts With", Value = "startswith"}};
    private List<OperatorsModel> between = new List<OperatorsModel> {new OperatorsModel {Text = "Between", Value = "between"}};
}

Steps to reproduce:
  1. Use query builder component and code section above
  2. Select field: First Name
  3. Select operator: Starts With
  4. Change field of same condition (not add new condition) to: Age
  5. Exception occurs
Thanks for your support.


2 Replies

MK Mohan Kumar Ramasamy Syncfusion Team January 4, 2021 01:51 PM UTC

Hi Hacinto, 
 
We have checked reported query. We can reproduce the reported issue in our end. We have logged an issue report for this, and we will include this fix in our upcoming patch release which will be scheduled on 13th January 2021 and appreciate your patience until then. You can track the status of this bug using below link.  
 
 
Regards, 
Mohan kumar R 
 



MK Mohan Kumar Ramasamy Syncfusion Team January 13, 2021 01:51 PM UTC

Hi Hacinto, 
 
Thank you for the patience. 
 
We are glad to announce that our weekly patch release (18.4.0.34) is rolled out. We have included the fix for the reported issue in this release. So, we suggest you upgrade our Syncfusion packages to our latest version in your end. (18.4.0.34) 
 
Regards, 
Mohan kumar R 


Loader.
Up arrow icon