ENH: guard against non-dictionary entries in changeDictionary (#1092)

This commit is contained in:
Mark Olesen
2018-11-22 13:59:49 +01:00
parent 85ffe4c648
commit 343a3b958d

View File

@ -99,6 +99,11 @@ HashTable<wordList> extractPatchGroups(const dictionary& boundaryDict)
for (const entry& dEntry : boundaryDict)
{
if (!dEntry.isDict())
{
continue;
}
const word& patchName = dEntry.keyword();
const dictionary& patchDict = dEntry.dict();
@ -552,7 +557,10 @@ int main(int argc, char *argv[])
dictionary fieldDict;
for (const entry& e : dictList)
{
fieldDict.add(e.keyword(), e.dict());
if (e.isDict())
{
fieldDict.add(e.keyword(), e.dict());
}
}
if (dictList.size())
@ -584,6 +592,12 @@ int main(int argc, char *argv[])
for (const entry& replaceEntry : replaceDicts)
{
if (!replaceEntry.isDict())
{
// Could also warn
continue;
}
const word& fieldName = replaceEntry.keyword();
const dictionary& replaceDict = replaceEntry.dict();