BUG: missing nullptr check in Function1/PatchFunction1 fallback logic

This commit is contained in:
Mark Olesen
2020-11-26 01:53:15 +01:00
parent b4eb214d56
commit 024d22cb64
2 changed files with 16 additions and 13 deletions

View File

@ -107,14 +107,15 @@ Foam::Function1<Type>::New
else if (!coeffs)
{
// Primitive entry. Coeffs dictionary is optional.
// Use keyword() - not entryName - for compatibility lookup!
coeffs =
&dict.optionalSubDict
const word& kw =
(
eptr->keyword() + "Coeffs",
keyType::LITERAL
eptr
? eptr->keyword() // Could be a compatibility lookup
: entryName
);
coeffs = &dict.optionalSubDict(kw + "Coeffs", keyType::LITERAL);
}

View File

@ -129,12 +129,14 @@ Foam::PatchFunction1<Type>::New
// Primitive entry. Coeffs dictionary is optional.
// Use keyword() - not entryName - for compatibility lookup!
coeffs =
&dict.optionalSubDict
const word& kw =
(
eptr->keyword() + "Coeffs",
keyType::LITERAL
eptr
? eptr->keyword() // Could be a compatibility lookup
: entryName
);
coeffs = &dict.optionalSubDict(kw + "Coeffs", keyType::LITERAL);
}