Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException in 3.0 branch #176

Closed
damageboy opened this issue Dec 11, 2013 · 4 comments
Closed

NullReferenceException in 3.0 branch #176

damageboy opened this issue Dec 11, 2013 · 4 comments
Labels
Milestone

Comments

@damageboy
Copy link

Got this exception

Details: System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Windows.Forms.Docking.DockPaneStripBase.OnMouseMove(MouseEventArgs e) in c:\projects\public\scm\dockpanelsuite.git\WinFormsUI\Docking\DockPaneStripBase.cs:line 217
   at System.Windows.Forms.Control.WmMouseMove(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);

            if (e.Button != MouseButtons.Left || _dragBox.Contains(e.Location)) 
                return;

            if (DockPane.DockPanel.AllowEndUserDocking && DockPane.AllowDockDragAndDrop && DockPane.ActiveContent.DockHandler.AllowEndUserDocking)
                DockPane.DockPanel.BeginDrag(DockPane.ActiveContent.DockHandler);
        }

Here's the faulty statement

@lextm
Copy link
Member

lextm commented Jan 11, 2014

Can you do some debugging to see which variable is null when this exception occurs? Without that piece of information, it is very hard to reproduce it.

@mehmetakifayas
Copy link

Hi lextm,
I'm having the same NullReferenceException in branch 3.0.
Bug steps to reproduce:
-Run DockSample project
-Create two dummy document (Document1, Document2)
-Dock Document2 to right of Document1
-Double click on the TabText of Document2 (to change Dockstate as float)
-Exception occurs.

@roken
Copy link
Member

roken commented Oct 22, 2014

Thanks for the repro steps! This is an issue on the 3.0 branch introduced by 364bfca.

@lextm
Copy link
Member

lextm commented Oct 26, 2014

Added an extra check on DockPane.ActiveContent to avoid the exception. Tested and it seems to work as expected.

@lextm lextm closed this as completed in 2c5c649 Dec 13, 2014
@lextm lextm modified the milestones: 2.10.0, 3.0.0 Jul 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants