From aa78b0301127fe706f2b5098fd1162fa2a5e72cc Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Thu, 29 Sep 2016 16:19:15 +0100 Subject: [PATCH] ENH: functionObjects - do not add to list if error on read --- .../functionObjectList/functionObjectList.C | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index c2c8309b45..bb0d7c2ce5 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -701,12 +701,14 @@ bool Foam::functionObjectList::read() "functionObject::" + objPtr->name() + "::read" ); - ok = objPtr->read(dict) && ok; + enabled = objPtr->read(dict); + ok = enabled && ok; } } - else + + if (!enabled) { - // Delete the disabled functionObject + // Delete the disabled/invalid(read) functionObject delete objPtr; objPtr = nullptr; continue;