diff options
author | louise <louise> | 2009-08-26 17:24:39 +0000 |
---|---|---|
committer | louise <louise> | 2009-08-26 17:24:39 +0000 |
commit | 47be3af4139fb43150201f145d73d057589746e5 (patch) | |
tree | 0aa83aa0b45149b2b8de0416e978c02d4f2402ff /perllib/Cobrand.pm | |
parent | 9f5f37ea2a64907b3695051191d1c5636980a958 (diff) |
Adding a cobrand param to the querystring has no effect if there is no cobrand in the domain or there is no perl module for the cobrand
Diffstat (limited to 'perllib/Cobrand.pm')
-rw-r--r-- | perllib/Cobrand.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/perllib/Cobrand.pm b/perllib/Cobrand.pm index fba948868..cd336f0e4 100644 --- a/perllib/Cobrand.pm +++ b/perllib/Cobrand.pm @@ -7,7 +7,7 @@ # Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved. # Email: louise@mysociety.org. WWW: http://www.mysociety.org # -# $Id: Cobrand.pm,v 1.3 2009-08-26 16:52:14 louise Exp $ +# $Id: Cobrand.pm,v 1.4 2009-08-26 17:24:39 louise Exp $ package Cobrand; use strict; @@ -35,7 +35,9 @@ sub cobrand_page{ my $cobrand_class = ucfirst($cobrand); my $class = "Cobrands::" . $cobrand_class . "::Util"; eval "use $class"; - my $handle = $class->new; + my $handle; + eval{ $handle = $class->new }; + return 0 if $@; my ($out, %params) = $handle->page($q); return ($out, %params); } |