mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 11:41:41 +00:00
Catch possible out_of_range
This commit is contained in:
parent
fce054319c
commit
8dbe60b0d5
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user