X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/70050c82fe8114fc5d86591035e71751bac21cc6..33754c4d83c59b7523a6da0c4fb21079cb60301c:/src/common/cmdproc.cpp diff --git a/src/common/cmdproc.cpp b/src/common/cmdproc.cpp index c2d44c895b..f6d7eb8dd5 100644 --- a/src/common/cmdproc.cpp +++ b/src/common/cmdproc.cpp @@ -154,12 +154,17 @@ bool wxCommandProcessor::Redo() { wxCommand *redoCommand = (wxCommand *) NULL; wxNode *redoNode = (wxNode *) NULL; - if (m_currentCommand && m_currentCommand->Next()) + + if ( m_currentCommand ) { - 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(); + } } - else + else // no current command, redo the first one { if (m_commands.Number() > 0) {