Completed
Last Updated: 19 Oct 2016 10:48 by Dominic
ADMIN
Peshito
Created on: 25 Apr 2016 08:44
Category: Buttons
Type: Bug Report
1
Buttons: NullReferenceException in Dispatcher call
There is a Dispatcher call without checking in the dispatcher call for NULL. This lead to NullReferenceException in huge production code.



Available in R3 2016 SP
1 comment
Dominic
Posted on: 28 Jun 2016 13:04
Reference to original discussion:
http://www.telerik.com/forums/raddropdownbutton-nullreferenceexception

Here ist he buggy code:
namespace Telerik.Windows.Controls
{
    [TelerikToolboxCategory("Navigation")]
    public class RadDropDownButton : RadButton, IPopupHost, IPopupWrapperOwner, IDisposable
    {
     
                private void OnLoaded(object sender, RoutedEventArgs e)
                {
                    this.isLoaded = true;
                    RadDropDownButton isOpen = sender as RadDropDownButton;
                    if (isOpen != null && isOpen.popupWrapper != null)
                    {
                    		
// *************Missing IF in the dispatcher call for checking isOpen.popupWrapper again for null	*************

                        base.Dispatcher.BeginInvoke(
() => isOpen.popupWrapper.IsOpen = this.IsOpen);
                    }
                }
        }
}