Hi,
We occassionally experience the following crash:
CodeObject 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.
Hello,
We have examined it, but this does not give us an idea on why the issue appears. Is it constantly reproduced on your side? If so, would you please describe in greater detail under what conditions it is reproduced, or better yet, provide us with a screencast, illustrating the issue in action? For instance, you can capture it using the free Jing tool from TechSmith.
I also noticed that you are working with an outdated product version. It is possible that we have already fixed this issue. Thus, I recommend that you upgrade the product to the latest available version. Please visit our version info page at http://www.devexpress.com/support/versions.xml to learn about the most recent versions of our products and obtain instructions on how to update them.
Hi Alexey,
We are getting this crash quite often but we are not able to reproduce it on constant basis. It happens when user clicks on button on the Ribbon but we don't have any more details. We are not able to simply upgrade to newer version because it is a huge task done on year basis.
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?
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.