Ticket Q503548
Visible to All Users

Crash in BarItemLink

created 12 years ago

Hi,

We occassionally experience the following crash:

Code
Object reference not set to an instance of an object. (NullReferenceException) at DevExpress.XtraBars.BarItemLink.get_CanSelectInCustomization() in c:\Builds\153\Sources\DevExpress.XtraBars\DevExpress.XtraBars\Items\BarItemLink.cs:line 315 at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.CanSelect(BarItemLink link) in c:\Builds\153\Sources\DevExpress.XtraBars\DevExpress.XtraBars\BarSelectionInfo.cs:line 888 at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.DoSelectedLinkChanging(BarItemLink oldLink, BarItemLink newLink) in c:\Builds\153\Sources\DevExpress.XtraBars\DevExpress.XtraBars\BarSelectionInfo.cs:line 875 at DevExpress.XtraBars.Utils.BarCustomizationManager.CheckAndStartHotCustomization(CustomLinksControl control, MouseEventArgs e, BarItemLink linkByPoint) in c:\Builds\153\Sources\DevExpress.XtraBars\DevExpress.XtraBars\BarCustomizationManager.cs:line 331 at DevExpress.XtraBars.Controls.CustomLinksControl.OnLeftMouseDown(DXMouseEventArgs e, BarItemLink link) in c:\Builds\153\Sources\DevExpress.XtraBars\DevExpress.XtraBars\Controls\CustomBarControl.cs:line 648 at DevExpress.XtraBars.Controls.CustomLinksControl.OnMouseDown(MouseEventArgs e) in c:\Builds\153\Sources\DevExpress.XtraBars\DevExpress.XtraBars\Controls\CustomBarControl.cs:line 701 at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at DevExpress.XtraBars.Controls.CustomControl.WndProc(Message& msg) in c:\Builds\153\Sources\DevExpress.XtraBars\DevExpress.XtraBars\Controls\CustomBarControl.cs:line 262 at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

We are not able to reproduce it in constnat basis, it happens when user clicks some button on the ribbon.

Could you please add null checks in your code to avoid this.

Thank you.

Show previous comments (2)
DevExpress Support Team 12 years ago

    Hello Nadiia,
    Would you please send a project that illustrates the issue you faced?
    We can mark this ticket as private for your security.

      Hi Alexey,
      I'm not able to provide you sample that would illustrate this issue because as I stated above it happens occassionally and we are not able to reproduce it. I checked our crashes statistics and we experienced this crash 29 times, recently it poped up several times at our customer side and we need to provide customer response. As far as I can see from your code the only object that can lead to this null ref can be BarItemLink.Item. In BarItemLink.IsImageExist there is check for Item != null, can you add same check in CanSelectInCustomization?

      DevExpress Support Team 12 years ago

        Hello Nadiia,
        We can not write checks in our controls without reproducing the issue, because this issue can be caused customers code.
        Please send us your project. We need to research you scenario.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.