Commit 0b039747 authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Protect against possible segmentation fault?

parent 20f64ce2
......@@ -163,7 +163,9 @@ void KoPencilTool::mouseReleaseEvent(KoPointerEvent *event)
m_hoveredPoint = 0;
// the original path may be different from the one added
canvas()->updateCanvas(m_shape->boundingRect());
if (canvas() && m_shape) {
canvas()->updateCanvas(m_shape->boundingRect());
}
delete m_shape;
m_shape = 0;
m_points.clear();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment