From f409b8e919683452dff648bba306cac535e11de2 Mon Sep 17 00:00:00 2001
From: Will Spooner <whs@sanger.ac.uk>
Date: Fri, 26 Mar 2004 12:25:57 +0000
Subject: [PATCH] Added a shout when no DensityTypes for logic name

---
 modules/Bio/EnsEMBL/DBSQL/DensityFeatureAdaptor.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/Bio/EnsEMBL/DBSQL/DensityFeatureAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/DensityFeatureAdaptor.pm
index 0c803d8e9c..7b89b5d6e6 100644
--- a/modules/Bio/EnsEMBL/DBSQL/DensityFeatureAdaptor.pm
+++ b/modules/Bio/EnsEMBL/DBSQL/DensityFeatureAdaptor.pm
@@ -117,7 +117,12 @@ sub fetch_all_by_Slice {
   #
 
   my $dta = $self->db()->get_DensityTypeAdaptor();
+
   my @dtypes = @{$dta->fetch_all_by_logic_name($logic_name)};
+  if( ! @dtypes ){
+    $self->warn( "No DensityTypes for logic name $logic_name" );
+    return [];
+  }
 
   my $best_ratio   = undef;
   my $density_type = undef;
-- 
GitLab