Skip to content
Snippets Groups Projects
Commit d138bea4 authored by Andy Yates's avatar Andy Yates
Browse files

According to test cases adaptor() should be nullable by passing an undef...

According to test cases adaptor() should be nullable by passing an undef through to the mutator. Detection of a purposful undef is by checking the length of @_
parent d63b60e9
No related branches found
No related tags found
No related merge requests found
......@@ -113,20 +113,22 @@ sub dbID {
=cut
sub adaptor {
my $self = shift;
if(@_) {
my $ad = shift;
if($ad && (!ref($ad) || !$ad->isa('Bio::EnsEMBL::DBSQL::BaseAdaptor'))) {
throw('Adaptor argument must be a Bio::EnsEMBL::DBSQL::BaseAdaptor');
my ($self, $adaptor) = @_;
if(scalar(@_) > 1) {
if(defined $adaptor) {
assert_ref($adaptor, 'Bio::EnsEMBL::DBSQL::BaseAdaptor', 'adaptor');
$self->{adaptor} = $adaptor;
weaken($self->{adaptor});
}
else {
$self->{adaptor} = undef;
}
weaken($self->{'adaptor'} = $ad);
}
return $self->{'adaptor'}
return $self->{adaptor}
}
=head2 is_stored
Arg [1] : Bio::EnsEMBL::DBSQL::DBConnection
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment