From e76b9dd7f111f094dfaf9c5ea15f7b20df82e43f Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Fri, 15 Apr 2016 12:56:04 +0200 Subject: [PATCH] BUGFIX. Comparison with null pointer --- opm/core/wells/WellsManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opm/core/wells/WellsManager.cpp b/opm/core/wells/WellsManager.cpp index 65a4e476..f9ad8569 100644 --- a/opm/core/wells/WellsManager.cpp +++ b/opm/core/wells/WellsManager.cpp @@ -766,9 +766,10 @@ namespace Opm } else if (well_potentials.size() > 0) { // default: calculate guide rates from well potentials // Note: Modification of the guide rate using GUIDERAT is not supported - const WellsGroupInterface& group = *wellnode.getParent(); + // only set the guide rates if there is a parent group with valied control - if (&group != NULL) { + if (wellnode.getParent() != nullptr) { + const WellsGroupInterface& group = *wellnode.getParent(); if ( well->isProducer(timeStep) ) { // The guide rates is calculated based on the group control // Currently only supporting WRAT, ORAT and GRAT.