Skip to content
Snippets Groups Projects
Commit f9953c6a authored by stefan's avatar stefan
Browse files

Fixes for SequenceHandle (added some checks)

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2197 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 4262881a
No related branches found
No related tags found
No related merge requests found
......@@ -63,8 +63,13 @@ SequenceImplPtr SequenceImpl::FromString(const String& seq_name,
void SequenceImpl::SetString(const String& seq)
{
seq_string_=seq;
this->ShiftsFromSequence();
if (SequenceImpl::IsSequenceStringSane(seq)) {
seq_string_=seq;
this->ShiftsFromSequence();
}
else {
throw InvalidSequence();
}
}
SequenceImpl::SequenceImpl(const String& seq_name,
......@@ -207,7 +212,7 @@ void SequenceImpl::AttachView(const mol::EntityView& view)
{
static const char* msg="Expected 1 chain, but %d chains found";
attached_view_=view;
if (attached_view_.GetChainCount()!=1) {
if (view.IsValid() && attached_view_.GetChainCount()!=1) {
throw IntegrityError(str(format(msg) % attached_view_.GetChainCount()));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment