diff --git a/pcbnew/dialogs/panel_setup_rules.cpp b/pcbnew/dialogs/panel_setup_rules.cpp index 40b7446c68..7640419b2b 100644 --- a/pcbnew/dialogs/panel_setup_rules.cpp +++ b/pcbnew/dialogs/panel_setup_rules.cpp @@ -114,7 +114,9 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent ) } else if( c == ')' ) { - sexprs.pop(); + if( !sexprs.empty() ) + sexprs.pop(); + context = NONE; } else if( c == ' ' )