diff --git a/src/app/ui/editor/standby_state.cpp b/src/app/ui/editor/standby_state.cpp index d8fd49cb9..205de71c7 100644 --- a/src/app/ui/editor/standby_state.cpp +++ b/src/app/ui/editor/standby_state.cpp @@ -243,7 +243,7 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg) if (handle != NoHandle) { int x, y, opacity; Image* image = location.image(&x, &y, &opacity); - if (image) { + if (layer && image) { if (!layer->isWritable()) { StatusBar::instance()->showTip(1000, "Layer '%s' is locked", layer->name().c_str()); @@ -258,7 +258,7 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg) } // Move selected pixels - if (editor->isInsideSelection() && msg->left()) { + if (layer && editor->isInsideSelection() && msg->left()) { if (!layer->isWritable()) { StatusBar::instance()->showTip(1000, "Layer '%s' is locked", layer->name().c_str());