Code

Fix for #1684042 (undo while adding a shape with the mouse results in a crash.)