From d65a031443ce1a87102b8ac966f22d739b23c335 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Fri, 31 Aug 2007 06:52:37 +0000 Subject: Allow empty DB_INFO and DB_NAME settings as long as they're defined. --- perl/Wallet/Server.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'perl/Wallet/Server.pm') diff --git a/perl/Wallet/Server.pm b/perl/Wallet/Server.pm index e7a419f..6bf4251 100644 --- a/perl/Wallet/Server.pm +++ b/perl/Wallet/Server.pm @@ -43,11 +43,12 @@ $VERSION = '0.01'; sub _open_db { my ($class) = @_; unless ($Wallet::Config::DB_DRIVER - and ($Wallet::Config::DB_INFO or $Wallet::Config::DB_NAME)) { + and (defined ($Wallet::Config::DB_INFO) + or defined ($Wallet::Config::DB_NAME))) { die "database connection information not configured\n"; } my $dsn = "DBI:$Wallet::Config::DB_DRIVER:"; - if ($Wallet::Config::DB_INFO) { + if (defined $Wallet::Config::DB_INFO) { $dsn .= $Wallet::Config::DB_INFO; } else { $dsn .= "database=$Wallet::Config::DB_NAME"; -- cgit v1.2.3