Completed
Last Updated: 28 Oct 2020 14:33 by ADMIN
Release 2020.R3.SP.next
Cyril Iselin
Created on: 08 Nov 2019 15:49
Category: AutoComplete
Type: Bug Report
0
NullReference after upgrading

We are upgraded from MVC 5 to MVC-Core and using now your core components (latest version).

In our AutoComplete box, we get now a NullReference exception, without changing anything at our codebase.

 

Generated Script from Kendo MVC-Core:

kendo.syncReady(function(){jQuery("#txtSearchForLink").kendoAutoComplete({"select":insertLink.searchResultSelected,"dataTextField":"Text","filter":"Contains","footerTemplate":jQuery('#searchResultFooterTemplate').html(),"minLength":0,"placeholder":"Suchen","template":jQuery('#searchResultTemplate').html(),"dataSource":{"type":"aspnetmvc-ajax","transport":{"read":{"url":"/Orphy/Search/GetQuickSearchData","data":insertLink.onAdditionalData}},"serverFiltering":true,"serverGrouping":true,"sort":[{"field":"Weight","dir":"desc"}],"group":[{"field":"GroupName","dir":"desc"}],"filter":[],"schema":{"data":"Data","model":{"id":"Id"}}}});});

 

Debugging:

-> context.Count == 0 -> so Null will returned
-> Here you access the property Memeber of Null ... ?

Call Stack:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Kendo.Mvc.Infrastructure.Implementation.FilterNodeVisitor.Visit(PropertyNode propertyNode)
   at Kendo.Mvc.Infrastructure.Implementation.PropertyNode.Accept(IFilterNodeVisitor visitor)
   at Kendo.Mvc.Infrastructure.FilterDescriptorFactory.Create(String input)
   at Kendo.Mvc.UI.DataSourceRequestModelBinder.<>c__DisplayClass2_0.<CreateDataSourceRequest>b__3(String filter)
   at Kendo.Mvc.UI.DataSourceRequestModelBinder.TryGetValue[T](ModelMetadata modelMetadata, IValueProvider valueProvider, String modelName, String key, Action`1 action)
   at Kendo.Mvc.UI.DataSourceRequestModelBinder.CreateDataSourceRequest(ModelMetadata modelMetadata, IValueProvider valueProvider, String modelName)
   at Kendo.Mvc.UI.DataSourceRequestModelBinder.BindModelAsync(ModelBindingContext bindingContext)
   at Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BinderTypeModelBinder.<BindModelAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.ModelBinding.ParameterBinder.<BindModelAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerBinderDelegateProvider.<>c__DisplayClass0_0.<<CreateBinderDelegate>g__Bind|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeInnerFilterAsync>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextExceptionFilterAsync>d__24.MoveNext() System.NullReferenceException: Object reference not set to an instance of an object.
   at Kendo.Mvc.Infrastructure.Implementation.FilterNodeVisitor.Visit(PropertyNode propertyNode)
   at Kendo.Mvc.Infrastructure.Implementation.PropertyNode.Accept(IFilterNodeVisitor visitor)
   at Kendo.Mvc.Infrastructure.FilterDescriptorFactory.Create(String input)
   at Kendo.Mvc.UI.DataSourceRequestModelBinder.<>c__DisplayClass2_0.<CreateDataSourceRequest>b__3(String filter)
   at Kendo.Mvc.UI.DataSourceRequestModelBinder.TryGetValue[T](ModelMetadata modelMetadata, IValueProvider valueProvider, String modelName, String key, Action`1 action)
   at Kendo.Mvc.UI.DataSourceRequestModelBinder.CreateDataSourceRequest(ModelMetadata modelMetadata, IValueProvider valueProvider, String modelName)
   at Kendo.Mvc.UI.DataSourceRequestModelBinder.BindModelAsync(ModelBindingContext bindingContext)
   at Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BinderTypeModelBinder.<BindModelAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.ModelBinding.ParameterBinder.<BindModelAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerBinderDelegateProvider.<>c__DisplayClass0_0.<<CreateBinderDelegate>g__Bind|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeInnerFilterAsync>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextExceptionFilterAsync>d__24.MoveNext()

 

Thanks for helping me.

 

Cyril

2 comments
ADMIN
Misho
Posted on: 11 Nov 2019 12:40

Hi Cyril,

I'm pleased to hear from you again.

Thank you for informing us about the issue you have found and providing us with the additional details from your research on it. I can confirm this is a bug and have logged it in our public repo as a bug report. Here is the public link for that bug where you could track the issue status:

https://github.com/telerik/kendo-ui-core/issues/5405 

As a token of gratitude for that report I'm updating your Telerik points.

Best Regards,
Misho
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Cyril Iselin
Posted on: 08 Nov 2019 16:12

Okay I found out your bug.

 

When you set in the AutoCompleteBuilder (may in all your builders) the Server filter property with the enum:

.Filter(FilterType.Contains)

you will render this in the Javascript init script:

"filter":"Contains"

that's wrong and will throw the exception I wrote bellow (see initial ticket). Correct is:

"filter":"contains"

then everything will work. As a workarround I'm using now:

.Filter(FilterType.Contains.ToString().ToLower())

j

You owe me a coffee!

 

Best Greetings

 

Cyril