mirror of https://github.com/aseprite/aseprite.git
Fix crash trying to move an empty cel with Move tool
This commit is contained in:
parent
91bacca270
commit
20120f432a
|
|
@ -40,6 +40,7 @@ MovingCelState::MovingCelState(Editor* editor, MouseMessage* msg)
|
|||
ASSERT(layer->isImage());
|
||||
|
||||
m_cel = layer->cel(editor->frame());
|
||||
ASSERT(m_cel); // The cel cannot be null
|
||||
if (m_cel) {
|
||||
m_celStart = m_cel->position();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,6 +189,10 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
|
|||
StatusBar::instance()->showTip(1000,
|
||||
"Layer '%s' is locked", layer->name().c_str());
|
||||
}
|
||||
else if (!layer->cel(editor->frame())) {
|
||||
StatusBar::instance()->showTip(1000,
|
||||
"Cel is empty, nothing to move");
|
||||
}
|
||||
else {
|
||||
// Change to MovingCelState
|
||||
editor->setState(EditorStatePtr(new MovingCelState(editor, msg)));
|
||||
|
|
|
|||
Loading…
Reference in New Issue