Fix crash when fetching bounding box of empty selection.

This commit is contained in:
Jeff Young 2019-06-13 15:45:11 +01:00
parent f0cd7a5fd9
commit 41441d9ced
1 changed files with 5 additions and 6 deletions

View File

@ -155,13 +155,12 @@ public:
{
EDA_RECT bbox;
bbox = Front()->GetBoundingBox();
auto i = m_items.begin();
++i;
for( ; i != m_items.end(); ++i )
if( Front() )
{
bbox.Merge( (*i)->GetBoundingBox() );
bbox = Front()->GetBoundingBox();
for( auto i = m_items.begin() + 1; i != m_items.end(); ++i )
bbox.Merge( (*i)->GetBoundingBox() );
}
return bbox;