diff --git a/image_analysis/structure_refinement/MonomerLibrary.cpp b/image_analysis/structure_refinement/MonomerLibrary.cpp index 593c4699a..5c7f7ee09 100644 --- a/image_analysis/structure_refinement/MonomerLibrary.cpp +++ b/image_analysis/structure_refinement/MonomerLibrary.cpp @@ -164,6 +164,9 @@ void ReadRestraintDictionary(const std::string &text, const std::string &name, R gemmi::cif::Block *block = doc.find_block(code); if (block == nullptr) block = doc.find_block("comp_" + code); + if (block == nullptr) + throw std::runtime_error(name + ": no data block " + code + " or comp_" + code + " with the " + "coordinates of its bonds without lengths"); try { RestrainToCoordinates(cc, *block); } catch (const std::exception &e) {