Commit 17663636 authored by Agata Cacko's avatar Agata Cacko

Fix crash in Overview docker in case of empty canvas

Before this crash, Overview docker would use its canvas in case
of rotation without checking if the canvas exist. This patch
fixes it by adding additional checks and returning from the function
in case of empty canvas.

Supposedly "it happens because when the canvas is deleted,
canvasOffsetXChanged is emitted".
parent df5a97ef
......@@ -129,6 +129,7 @@ void OverviewDockerDock::unsetCanvas()
void OverviewDockerDock::rotateCanvasView(qreal rotation)
{
if (!m_canvas) return;
KisCanvasController *canvasController =
dynamic_cast<KisCanvasController*>(m_canvas->viewManager()->canvasBase()->canvasController());
if (canvasController) {
......@@ -138,6 +139,7 @@ void OverviewDockerDock::rotateCanvasView(qreal rotation)
void OverviewDockerDock::updateSlider()
{
if (!m_canvas) return;
KisSignalsBlocker l(m_rotateSlider);
qreal rotation = m_canvas->rotationAngle();
......
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