#6038 Avoid crashing when facies colors does not exist.

This commit is contained in:
Kristian Bendiksen 2020-06-30 14:10:44 +02:00
parent 9f0a6c6223
commit 3425031e27

View File

@ -220,10 +220,12 @@ QList<caf::PdmOptionItemInfo> RimFractureModel::calculateValueOptions( const caf
else if ( fieldNeedingOptions == &m_overburdenFacies || fieldNeedingOptions == &m_underburdenFacies )
{
RimColorLegend* faciesColors = RimProject::current()->colorLegendCollection()->findByName( "Facies colors" );
for ( RimColorLegendItem* item : faciesColors->colorLegendItems() )
if ( faciesColors )
{
options.push_back( caf::PdmOptionItemInfo( item->categoryName(), item->categoryName() ) );
for ( RimColorLegendItem* item : faciesColors->colorLegendItems() )
{
options.push_back( caf::PdmOptionItemInfo( item->categoryName(), item->categoryName() ) );
}
}
}