mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-05 05:37:10 -06:00
#7361 Janitor : Guard null pointer access
This commit is contained in:
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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user