diff --git a/ApplicationCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp b/ApplicationCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp index 201595e6e7..8bc7af3494 100644 --- a/ApplicationCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp +++ b/ApplicationCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp @@ -427,17 +427,19 @@ void RimStimPlanModelWellLogCalculator::scaleByNetToGross( const RimStimPlanMode return; } - double cutoff = 1.0; - if ( stimPlanModel->stimPlanModelTemplate() && stimPlanModel->stimPlanModelTemplate()->nonNetLayers() && - stimPlanModel->stimPlanModelTemplate()->nonNetLayers()->isChecked() ) + double netToGrossCutoff = 1.0; + bool useNetToGross = false; + + if ( stimPlanModel->stimPlanModelTemplate() && stimPlanModel->stimPlanModelTemplate()->nonNetLayers() ) { - cutoff = stimPlanModel->stimPlanModelTemplate()->nonNetLayers()->cutOff(); + netToGrossCutoff = stimPlanModel->stimPlanModelTemplate()->nonNetLayers()->cutOff(); + useNetToGross = !netToGross.empty() && stimPlanModel->stimPlanModelTemplate()->nonNetLayers()->isChecked(); } for ( size_t i = 0; i < values.size(); i++ ) { double ntg = netToGross[i]; - if ( ntg <= cutoff ) + if ( useNetToGross && ntg <= netToGrossCutoff ) { values[i] = ntg * values[i]; }