#7361 Janitor : Guard null pointer access

This commit is contained in:
Magne Sjaastad committed 2021-02-24 22:16:23 +01:00
1 parent 1a28e71b68
commit ce2dd46a2e
6 files changed
+8 -29

No files matched your search

@@ -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;
}
//--------------------------------------------------------------------------------------------------