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

Asking if a dereferenced array ref is undefined is not testing what you think...

Asking if a dereferenced array ref is undefined is not testing what you think it is and is deprecated in Perl 5.16.0. You are seeing if the first element was defined when in actual fact you needed to assert if the array reference was undefined and act accordingly.
parent 21c43846
No related branches found
No related tags found
No related merge requests found
......@@ -224,14 +224,17 @@ sub operon {
=cut
sub get_all_Genes {
my $self = shift;
if ( !defined @{$self->{'_gene_array'}} && defined $self->dbID) {
if ( defined $self->adaptor() ) {
my $ta = $self->adaptor()->db()->get_OperonTranscriptAdaptor();
my $transcripts = $ta->fetch_genes_by_operon_transcript($self);
$self->{'_gene_array'} = $transcripts;
}
if(! defined $self->{_gene_array}) {
if(defined $self->dbID() && defined $self->adaptor()) {
my $ta = $self->adaptor()->db()->get_OperonTranscriptAdaptor();
my $transcripts = $ta->fetch_genes_by_operon_transcript($self);
$self->{_gene_array} = $transcripts;
}
else {
$self->{_gene_array} = [];
}
}
return $self->{'_gene_array'};
return $self->{_gene_array};
}
=head2 add_gene
......@@ -249,6 +252,7 @@ sub add_gene {
push @{$self->get_all_Genes()},$gene;
return;
}
=head2 add_DBEntry
Arg [1] : Bio::EnsEMBL::DBEntry $dbe
......
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