#7361 Janitor : Guard null pointer access

This commit is contained in:
Magne Sjaastad
2021-02-24 20:39:14 +01:00
parent 1a28e71b68
commit ce2dd46a2e
6 changed files with 8 additions and 29 deletions

View File

@@ -235,7 +235,12 @@ size_t RimDepthTrackPlot::plotIndex( const RimPlot* plot ) const
//--------------------------------------------------------------------------------------------------
RimPlot* RimDepthTrackPlot::plotByIndex( size_t index ) const
{
return m_plots[index];
if ( index < m_plots.size() )
{
return m_plots[index];
}
return nullptr;
}
//--------------------------------------------------------------------------------------------------