diff --git a/modules/conop/src/compound_lib_base.cc b/modules/conop/src/compound_lib_base.cc index 5fda96f37691a21a62f7420bb21bbb7a81693cce..e5e9c3d09c4eeacf0c49a510c7716fd736bf8dcc 100644 --- a/modules/conop/src/compound_lib_base.cc +++ b/modules/conop/src/compound_lib_base.cc @@ -1,11 +1,19 @@ #include "compound_lib_base.hh" +#include <ost/message.hh> namespace ost { namespace conop { bool CompoundLibBase::IsResidueComplete(const ost::mol::ResidueHandle& res, bool check_hydrogens, Compound::Dialect dialect) const{ CompoundPtr compound = this->FindCompound(res.GetName(), dialect); - AtomSpecList a_spec = compound->GetAtomSpecs(); + + if(!compound){ + std::stringstream ss; + ss << "Could not find " << res.GetName() << " in compound library"; + throw Error(ss.str()); + } + + const AtomSpecList& a_spec = compound->GetAtomSpecs(); for(AtomSpecList::const_iterator it=a_spec.begin(); it!=a_spec.end();++it){