Fix crash in WBS curves when rkb diff is 0

This commit is contained in:
Gaute Lindkvist
2020-05-13 11:50:10 +02:00
parent e0fd47ef6e
commit 24d58e3a98
2 changed files with 18 additions and 20 deletions

View File

@@ -148,28 +148,25 @@ std::vector<double> RigWellLogCurveData::depths( RiaDefines::DepthTypeEnum depth
return it->second;
}
if ( m_rkbDiff != 0.0 )
if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB &&
m_depths.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ) )
{
if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB &&
m_depths.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ) )
std::vector<double> tvds = depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH );
for ( double& tvdValue : tvds )
{
std::vector<double> tvds = depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH );
for ( double& tvdValue : tvds )
{
tvdValue += m_rkbDiff;
}
return tvds;
tvdValue += m_rkbDiff;
}
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH &&
m_depths.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB ) )
return tvds;
}
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH &&
m_depths.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB ) )
{
std::vector<double> tvds = depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB );
for ( double& tvdValue : tvds )
{
std::vector<double> tvds = depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB );
for ( double& tvdValue : tvds )
{
tvdValue -= m_rkbDiff;
}
return tvds;
tvdValue -= m_rkbDiff;
}
return tvds;
}
return std::vector<double>();
}