From 0b339276a68777dd8865f166b6c26ab59452c050 Mon Sep 17 00:00:00 2001 From: Graham McVicker <mcvicker@sanger.ac.uk> Date: Wed, 10 Mar 2004 16:06:56 +0000 Subject: [PATCH] added argument checking to get_mapping_path --- modules/Bio/EnsEMBL/DBSQL/CoordSystemAdaptor.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/Bio/EnsEMBL/DBSQL/CoordSystemAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/CoordSystemAdaptor.pm index ec4643b588..a9c4b5fa39 100644 --- a/modules/Bio/EnsEMBL/DBSQL/CoordSystemAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/CoordSystemAdaptor.pm @@ -665,6 +665,12 @@ sub get_mapping_path { my $cs1 = shift; my $cs2 = shift; + if(!ref($cs1) || !ref($cs2) || + !$cs1->isa('Bio::EnsEMBL::CoordSystem') || + !$cs2->isa('Bio::EnsEMBL::CoordSystem')) { + throw('Two Bio::EnsEMBL::CoordSystem arguments expected.'); + } + my $key1 = $cs1->name() . ":" . $cs1->version(); my $key2 = $cs2->name() . ":" . $cs2->version(); -- GitLab