diff --git a/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/ejabberd.pm b/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/ejabberd.pm index 188ba96..5207d17 100644 --- a/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/ejabberd.pm +++ b/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/ejabberd.pm @@ -220,12 +220,14 @@ sub change_settings { $rec = $db->get('spectrum'); - foreach my $proto (@transports){ - if (grep ($proto, @gateways)){ - $rec->set_prop("$proto",'enabled'); - } - else{ - $rec->set_prop("$proto",'disabled'); + if ($rec){ + foreach my $proto (@transports){ + if (grep ($proto, @gateways)){ + $rec->set_prop("$proto",'enabled'); + } + else{ + $rec->set_prop("$proto",'disabled'); + } } } @@ -266,6 +268,8 @@ sub print_gateways my ($self) = @_; my $q = $self->{cgi}; + my $spectrum = $db->get('spectrum') || return undef; + print "", $self->localise('LABEL_GATEWAYS'), "\n"; @@ -275,7 +279,6 @@ sub print_gateways esmith::cgi::genSmallCell($q, $self->localise('PROTOCOL'),"header"), esmith::cgi::genSmallCell($q, $self->localise('STATUS'),"header"), ); - my $spectrum = $db->get('spectrum'); foreach my $proto (@transports){ my $status = $spectrum->prop($proto) || 'disabled';