Unplanned
Last Updated: 16 May 2024 11:52 by ADMIN
Matt
Created on: 10 May 2024 17:24
Category: UI for WinForms
Type: Bug Report
0
RadValidationProvider: ValidateCore throws System.NullReferenceException if assigned value of PropertyName is not found

 

 

When a RadValidationRule has the "PropertyName" assigned to a non-existent property, the RadVAlidationProvider.ValidateCore throws a NullReference exception because the property cannot be found via reflection and throws no error handling.

 

From OpenEdge ABL class, this is the code written into the forms InitializeComponent method.  The "IsValid"  property doesn't actually exist.

        radValidationRule3:AddControl(THIS-OBJECT:myTextBox).         radValidationRule3:Operator = Telerik.WinControls.Data.FilterOperator:IsNotEqualTo.         radValidationRule3:PropertyName = "IsValid".         radValidationRule3:ToolTipText = "Test".         radValidationRule3:Value = TRUE.

 

While we don't expect the functionality to actually work because the property isn't actually available to .NET, but the NullReferenceException is poorly handled.

 

I've attached a screenshot of the bit of code from RadValidationProvider.ValidateCore where this occurs.  This is from version 2020.3.1020.20

Here is the thrown stack exception details from visual studio.

System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Telerik.WinControls.UI
StackTrace:
at Telerik.WinControls.UI.RadValidationProvider.ValidateCore(Object sender, EventArgs e)

 

This

1 comment
ADMIN
Dinko | Tech Support Engineer
Posted on: 16 May 2024 11:52

Hi Matt,

The provided details are greatly appreciated. 

I have followed your steps and indeed the reported exception is reproducible. Therefore I have changed the status of the item to Unplanned as we agree that this should be handled on our side. You can follow the item so that you can be notified of its status change.

In the meantime, what I can suggest is to ensure that the property set to the validation rule exists in the associated control.

Your Telerik Points are updated for bringing this to our attention.

Regards,
Dinko | Tech Support Engineer
Progress Telerik

A brand new ThemeBuilder course was just added to the Virtual Classroom. The training course was designed to help you get started with ThemeBuilder for styling Telerik and Kendo UI components for your applications. You can check it out at https://learn.telerik.com