()() Guard against null ptrs in name comparisons

This commit is contained in:
Jacob Støren 2015-11-30 14:50:16 +01:00
parent d637248ae9
commit 9d9ff798a9
2 changed files with 12 additions and 2 deletions

View File

@ -336,7 +336,12 @@ void RimEclipseWellCollection::calculateIsWellPipesVisible(size_t frameIndex)
bool lessEclipseWell(const caf::PdmPointer<RimEclipseWell>& w1, const caf::PdmPointer<RimEclipseWell>& w2)
{
return (w1->name() < w2->name());
if (w1.notNull() && w2.notNull())
return (w1->name() < w2->name());
else if (w1.notNull())
return true;
else
return false;
}
//--------------------------------------------------------------------------------------------------

View File

@ -389,7 +389,12 @@ void RimWellPathCollection::removeWellPath(RimWellPath* wellPath)
bool lessWellPath(const caf::PdmPointer<RimWellPath>& w1, const caf::PdmPointer<RimWellPath>& w2)
{
return (w1->name() < w2->name());
if (w1.notNull() && w2.notNull())
return (w1->name() < w2->name());
else if (w1.notNull())
return true;
else
return false;
}
//--------------------------------------------------------------------------------------------------