Catch possible out_of_range

This commit is contained in:
Seth Hillbrand 2021-10-11 10:06:40 -07:00
parent fce054319c
commit 8dbe60b0d5
1 changed files with 9 additions and 1 deletions

View File

@ -29,6 +29,7 @@
#include <set>
#include <vector>
#include <bitset>
#include <stdexcept>
#include <wx/string.h>
@ -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;
}
}
/**