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; + } } /**