Don't throw an exception you have no intention of catching.

This commit is contained in:
Jeff Young 2020-01-13 14:42:48 +00:00
parent 81ee5edcaf
commit d3c7bd3a88
1 changed files with 12 additions and 2 deletions

View File

@ -260,7 +260,12 @@ public:
ITEM_PTR_VECTOR& operator[]( int aType )
{
if( ( aType < FIRST_TYPE ) || ( aType > LAST_TYPE ) )
throw std::out_of_range( "MULTIVECTOR out of range" );
{
wxFAIL_MSG( "Attempted access to type not within MULTIVECTOR" );
// return type is a reference so we have to return something...
aType = FIRST_TYPE;
}
return m_data[ aType - FIRST_TYPE ];
}
@ -268,7 +273,12 @@ public:
const ITEM_PTR_VECTOR& operator[]( int aType ) const
{
if( ( aType < FIRST_TYPE ) || ( aType > LAST_TYPE ) )
throw std::out_of_range( "MULTIVECTOR out of range" );
{
wxFAIL_MSG( "Attempted access to type not within MULTIVECTOR" );
// return type is a reference so we have to return something...
aType = FIRST_TYPE;
}
return m_data[ aType - FIRST_TYPE ];
}