Skip to content
Snippets Groups Projects
Unverified Commit 9215b6e7 authored by Xavier Robin's avatar Xavier Robin
Browse files

fix: SCHWED-4345 allow returning null pointer.

This allows IsValid() to work as intended without throwing an exception.
Because the validity of the underlying entity is now checked in CheckValidity,
it should no longer be a problem.
parent c117aa66
No related branches found
No related tags found
No related merge requests found
......@@ -73,9 +73,6 @@ void AtomImpl::Apply(EntityVisitor& v)
ResidueImplPtr AtomImpl::GetResidue() const
{
if (!res_.lock()) {
throw InvalidHandle();
}
return res_.lock();
}
......@@ -218,7 +215,7 @@ AtomImpl::~AtomImpl() {
EntityImplPtr AtomImpl::GetEntity() const
{
if (!res_.lock()) {
throw InvalidHandle();
return EntityImplPtr();
}
return res_.lock()->GetEntity();
}
......
......@@ -369,9 +369,6 @@ AtomImplPtr ChainImpl::FindAtom(const ResNum& num,
EntityImplPtr ChainImpl::GetEntity() const
{
if (!ent_.lock()) {
throw InvalidHandle();
}
return ent_.lock();
}
int ChainImpl::GetIndexForResNum(const ResNum& number) const
......
......@@ -200,9 +200,6 @@ void ResidueImpl::SetSecStructure(SecStructure ss)
EntityImplPtr ResidueImpl::GetEntity() const
{
if (!ent_.lock()) {
throw InvalidHandle();
}
return ent_.lock();
}
......@@ -259,9 +256,6 @@ int ResidueImpl::GetBondCount() const
ChainImplPtr ResidueImpl::GetChain() const
{
if (!chain_.lock()) {
throw InvalidHandle();
}
return chain_.lock();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment