mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-02 09:00:14 -06:00
#14112 Contour map: guard null legend config in defineUiOrdering
Selecting a contour map projection in the tree could crash when the associated legend config was null. RimContourMapProjection::defineUiOrdering called legendConfig()->uiOrdering() unguarded. Because PdmUiObjectHandle::uiOrdering is non-virtual, the call entered with a null this and then crashed on the virtual defineUiOrdering dispatch. Guard the legendConfig() dereference, matching the existing null checks elsewhere in the file. Apply the same guard to RimEclipseCellColors::defineUiOrdering.
This commit is contained in:
1 parent
0275191b36
commit
ea719c41b3
2 files changed
+5
-2
No files matched your search
@@ -613,7 +613,10 @@ void RimContourMapProjection::defineUiOrdering( QString uiConfigName, caf::PdmUi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
legendConfig()->uiOrdering( "NumLevelsOnly", *mainGroup );
|
if ( legendConfig() )
|
||||||
|
{
|
||||||
|
legendConfig()->uiOrdering( "NumLevelsOnly", *mainGroup );
|
||||||
|
}
|
||||||
mainGroup->add( &m_resolution );
|
mainGroup->add( &m_resolution );
|
||||||
mainGroup->add( &m_showContourLines );
|
mainGroup->add( &m_showContourLines );
|
||||||
mainGroup->add( &m_showContourLabels );
|
mainGroup->add( &m_showContourLabels );
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ void RimEclipseCellColors::defineUiOrdering( QString uiConfigName, caf::PdmUiOrd
|
|||||||
{
|
{
|
||||||
RimEclipseResultDefinition::defineUiOrdering( uiConfigName, uiOrdering );
|
RimEclipseResultDefinition::defineUiOrdering( uiConfigName, uiOrdering );
|
||||||
|
|
||||||
if ( uiConfigName == "AddLegendLevels" )
|
if ( uiConfigName == "AddLegendLevels" && legendConfig() )
|
||||||
{
|
{
|
||||||
legendConfig()->uiOrdering( "NumIntervalsOnly", uiOrdering );
|
legendConfig()->uiOrdering( "NumIntervalsOnly", uiOrdering );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user