Commit 3d6ff8e2 authored by Marek Szuba's avatar Marek Szuba
Browse files

RNAProduct::get_all_Attributes(): do not throw when data unavailable

Previously, get_all_Attributes() would throw an exception in the event
of absence of both the local attribute cache and the adaptor link. That
was not entirely correct because a locally created RNAProduct object
which has not been assigned any attributes would look exactly like that.
get_all_DBEntries() got that right so let's follow its example.
parent 4d41b198
......@@ -370,8 +370,7 @@ sub genomic_start {
Description: Gets a list of Attributes of this rnaproduct.
Optionally just get Attributes for given code.
Returntype : listref Bio::EnsEMBL::Attribute
Exceptions : Throws if there is no adaptor or defined for the rnaproduct
Exceptions : none
Caller : general
Status : Stable
......@@ -380,11 +379,8 @@ sub genomic_start {
sub get_all_Attributes {
my ($self, $attrib_code) = @_;
if (! exists $self->{'attributes'}) {
if (!$self->adaptor()) {
throw("Adaptor not set for rnaproduct, cannot fetch its attributes");
# if not cached, retrieve all of the attributes for this rnaproduct
if (!defined($self->{'attributes'}) && defined($self->adaptor())) {
my $aa = $self->adaptor->db->get_AttributeAdaptor();
$self->{'attributes'} = $aa->fetch_all_by_RNAProduct($self);
Markdown is supported
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