- redoCommand = (wxCommand *)m_currentCommand->Next()->Data();
- redoNode = m_currentCommand->Next();
+ // is there anything to redo?
+ if ( m_currentCommand->Next() )
+ {
+ redoCommand = (wxCommand *)m_currentCommand->Next()->Data();
+ redoNode = m_currentCommand->Next();
+ }