Properly handle an error condition
Found by coverity
This commit is contained in:
parent
54c03ea6cb
commit
433a3ad7a4
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue