diff --git a/pcbnew/plugins/pcad/s_expr_loader.cpp b/pcbnew/plugins/pcad/s_expr_loader.cpp index c0aa0a9c8d..cb5b8b52c4 100644 --- a/pcbnew/plugins/pcad/s_expr_loader.cpp +++ b/pcbnew/plugins/pcad/s_expr_loader.cpp @@ -70,6 +70,10 @@ static const char ACCEL_ASCII_KEYWORD[] = "ACCEL_ASCII"; if( tok == DSN_RIGHT ) { iNode = iNode->GetParent(); + + // this will happen if there are more right parens than left + if( !iNode ) + THROW_IO_ERROR( wxT( "Unexpected right paren" ) ); } else if( tok == DSN_LEFT ) {