From 42a2f134643d2923f78f9e7980e887a49f0cfe88 Mon Sep 17 00:00:00 2001 From: Ben Ellis Date: Tue, 21 Jul 2020 14:52:48 +0000 Subject: [PATCH] Added a check that sexprs isn't empty before popping This fixes a crash on malformed sexprs in the DRC rules panel --- pcbnew/dialogs/panel_setup_rules.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 == ' ' )