Bug #70518 Null reference exception when drawing layer under tables
Submitted: 4 Oct 2013 6:27 Modified: 6 Nov 2013 22:25
Reporter: Nikola Novak Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:6.0.7.11215 OS:Windows (8)
Assigned to: CPU Architecture:Any
Tags: layer, model, null, undo

[4 Oct 2013 6:27] Nikola Novak
Description:
MySQL Workbench encounters a null reference exception when the second layer is drawn under some tables. This happens no matter how you draw the layer, as long as there are tables over it.

How to repeat:
1. Create a new model (or open existing one and continue with step 4).
2. Add a diagram.
3. In the diagram, create at least one table (empty or not, doesn't matter).
4. Draw a layer under the table so that it encompasses the table.
5. Click undo.
6. Draw another layer, again so that it encompasses the table.
[4 Oct 2013 6:41] Nikola Novak
After this, adding new layers results in the same error. It is possible to save the work and reload and the bug won't resurface. Any added layers after the bug happened will be black.

(Edit: Changed severity.)
[4 Oct 2013 14:38] MySQL Verification Team
Thank you for the bug report.

Exception = System.NullReferenceException
Message = Object reference not set to an instance of an object.
FullText = System.NullReferenceException: Object reference not set to an instance of an object.
   at MySQL.Forms.TreeNodeImpl.remove_from_parent(TreeNodeImpl* )
   at wb.ModelDiagramForm.handle_mouse_button(ModelDiagramForm* , MouseButton , Boolean , Int32 , Int32 , EventState )
   at MySQL.Workbench.ModelDiagramFormWrapper.OnMouseUp(MouseEventArgs e, Int32 X, Int32 Y, Keys keystate, MouseButtons buttons)
   at MySQL.GUI.Workbench.ModelDiagramForm.CanvasPanel_MouseUp(Object sender, MouseEventArgs e)
   at System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e)
   at MySQL.Utilities.WindowsCanvasViewerPanel.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
[6 Nov 2013 22:25] Philip Olson
Fixed as of MySQL Workbench 6.0.8, and here's the changelog entry:

When creating a table on a model diagram, an unhandled NULL reference
exception was thrown when a second layer was drawn under some tables.

Thank you for the bug report.