From bac4579b4b756b5a9c5dfd251a20f811d3972e6f Mon Sep 17 00:00:00 2001
From: Web Admin <w3adm@sanger.ac.uk>
Date: Fri, 1 Apr 2005 11:34:33 +0000
Subject: [PATCH] better handlers archive stable ids

---
 modules/Bio/EnsEMBL/ArchiveStableId.pm | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/modules/Bio/EnsEMBL/ArchiveStableId.pm b/modules/Bio/EnsEMBL/ArchiveStableId.pm
index bc039161c3..14c7430a30 100644
--- a/modules/Bio/EnsEMBL/ArchiveStableId.pm
+++ b/modules/Bio/EnsEMBL/ArchiveStableId.pm
@@ -222,16 +222,18 @@ sub get_translation_archive_id {
   my $self = shift;
 
   if( $self->type() eq "Transcript" ) {
-    return [$self->adaptor->fetch_by_transcript_archive_id( $self )];
+    my $T = $self->adaptor->fetch_by_transcript_archive_id( $self );
+    return $T ? [$T] : [];
   } elsif( $self->type() eq "Gene" ) {
     my $transcripts = $self->adaptor->fetch_all_by_gene_archive_id( $self );
-	my @peptides ;
-	for (@$transcripts) {
-		push @peptides , $self->adaptor->fetch_by_transcript_archive_id( $_ );
-	}
-	return \@peptides;
+    my @peptides ;
+    for (@$transcripts) {
+      my $T = $self->adaptor->fetch_by_transcript_archive_id( $_ );
+      push @peptides, $T if $T;
+    }
+    return \@peptides;
   } else {
-    return undef;
+    return [$self];
   }
 }
 
-- 
GitLab