my $profile = '';
- if ( lc($r->content_type) =~ /^text\/html/
+ if ( $r && lc($r->content_type) =~ /^text\/html/
&& $FS::CurrentUser::CurrentUser->option('show_db_profile')
)
{
dbh->{'private_profile'} = {};
- s/(<\/BODY>[\s\n]*<\/HTML>[\s\n]*)$/$profile$1/i;
+ s/(<\/BODY>[\s\n]*<\/HTML>[\s\n]*)/$profile$1/i;
}
</%filter>
<%cleanup>
- dbh->commit();
+ dbh->commit() if dbh;
</%cleanup>