Commit 86fe3ff9 authored by David Thompson's avatar David Thompson
Browse files

Fix bad shared_ptr dereference.

Always verify that map entries exist before accessing the shared
pointer held by the map.
parent aa7558bf
......@@ -662,13 +662,16 @@ struct Neighborhood
winner = this->m_regionIds.mergeSets(idA, idB);
RegionIdSet::value_type loser = (winner == idA ? idB : idA);
// If this is a new region, create a record for it.
if (!this->m_regions[winner])
if (this->m_regions.find(winner) == this->m_regions.end())
this->m_regions[winner] = smtk::make_shared<Region>(*ringB, !isOutB);
if (this->m_regions.find(loser) != this->m_regions.end())
{ // Add coedges (of exiting edges on inside of A--B) to region.
winner = idA;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment