Add some asserts in cmd::AddCel

This commit is contained in:
David Capello 2016-06-14 12:59:08 -03:00
parent 19b31ff31a
commit a738f3ed32

View File

@ -39,6 +39,8 @@ void AddCel::onExecute()
{
Layer* layer = this->layer();
Cel* cel = this->cel();
ASSERT(layer);
ASSERT(cel);
addCel(layer, cel);
}
@ -47,6 +49,8 @@ void AddCel::onUndo()
{
Layer* layer = this->layer();
Cel* cel = this->cel();
ASSERT(layer);
ASSERT(cel);
// Save the CelData only if the cel isn't linked
bool has_data = (cel->links() == 0);
@ -64,6 +68,7 @@ void AddCel::onUndo()
void AddCel::onRedo()
{
Layer* layer = this->layer();
ASSERT(layer);
SubObjectsFromSprite io(layer->sprite());
bool has_data = (read8(m_stream) != 0);
@ -75,6 +80,7 @@ void AddCel::onRedo()
io.addCelDataRef(celdata);
}
Cel* cel = read_cel(m_stream, &io);
ASSERT(cel);
addCel(layer, cel);