Skip to content

Commit

Permalink
Properly handle an error condition
Browse files Browse the repository at this point in the history
Found by coverity
  • Loading branch information
AI0867 committed Jun 10, 2016
1 parent 54c03ea commit 433a3ad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/actions/undo.cpp
Expand Up @@ -321,6 +321,11 @@ void undo_list::read(const config & cfg)
undo_action_base * action = create_action(child);
if ( undo_action* undoable_action = dynamic_cast<undo_action*>(action)) {
redos_.push_back(undoable_action);
} else {
delete action;
ERR_NG << "Error: redo contained action that is not undoable" << std::endl;
ERR_NG << "config was: " << child.debug() << std::endl;
ERR_NG << "Skipping this redo action..." << std::endl;
}
} catch (bad_lexical_cast &) {
ERR_NG << "Error when parsing redo list from config: bad lexical cast." << std::endl;
Expand Down

0 comments on commit 433a3ad

Please sign in to comment.