From 8dbe60b0d529bd59c7309e1d852eb4e31ef70592 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 11 Oct 2021 10:06:40 -0700 Subject: [PATCH] Catch possible out_of_range --- include/layer_ids.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/layer_ids.h b/include/layer_ids.h index 739ecd3c52..7ab520ed5a 100644 --- a/include/layer_ids.h +++ b/include/layer_ids.h @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -573,7 +574,14 @@ public: */ bool Contains( PCB_LAYER_ID aLayer ) { - return test( aLayer ); + try + { + return test( aLayer ); + } + catch( std::out_of_range& ) + { + return false; + } } /**