only perform size check if section is present

This commit is contained in:
Axel Kohlmeyer
2025-06-14 11:47:24 -04:00
parent e2cd2a1a17
commit ea23af48d3

View File

@ -307,7 +307,7 @@ void Molecule::from_json(const std::string &molid, const json &moldata)
"Molecule template {}: JSON data for molecule does not contain required '{}' field", id, \
#field); \
} \
if (sizecheck && (sizecheck != sizevar)) \
if (flagvar && sizecheck && (sizecheck != sizevar)) \
error->all(FLERR, Error::NOLASTLINE, \
"Molecule template {}: Found {} instead of {} data entries for '{}'", id, sizevar, \
sizecheck, #field);