Skip to content
Snippets Groups Projects
Commit 8b548c33 authored by Marco Biasini's avatar Marco Biasini
Browse files

fix BZDNG-310

parent 42238717
No related branches found
No related tags found
No related merge requests found
......@@ -66,10 +66,14 @@ int AlignmentHandle::GetResidueIndex(int seq_index, int pos) const
void AlignmentHandle::AddSequence(const ConstSequenceHandle& sequence)
{
this->CheckValidity();
if (!sequence.IsValid() || (impl_->GetCount()>0 &&
impl_->GetSequence(0)->GetLength()!=sequence.GetLength())) {
if (!sequence.IsValid()) {
throw InvalidSequence();
}
if (!(impl_->GetCount()>0 &&
impl_->GetSequence(0)->GetLength()!=sequence.GetLength())) {
throw std::runtime_error("sequence doesn't have the same length as the "
"alignment");
}
return impl_->AddSequence(sequence.Impl());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment