diff --git a/NEWS b/NEWS index afabf71..ec22047 100644 --- a/NEWS +++ b/NEWS @@ -20,7 +20,7 @@ In this alpha5 release, we have added: Bug fixes: -None +* Fixed a bug when viewing non-existent quotes. Incompatibilities: diff --git a/doc/CHANGELOG b/doc/CHANGELOG index ed53d88..b7688c9 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev =============================================================================== + * Fixed an odd bug when viewing non-existent quotes. * You can now define how many results are returned by QDB SEARCH/MORE at a time with qdb_search_resnum in the config. * Added SEARCH and MORE to QDB. diff --git a/modules/QDB.pm b/modules/QDB.pm index 0260b4b..0c01bfa 100644 --- a/modules/QDB.pm +++ b/modules/QDB.pm @@ -81,6 +81,9 @@ sub cmd_qdb $dbq->execute($argv[1]) or notice($src->{svr}, $src->{nick}, trans('An error occurred').'. Quote might not exist.') and return; my @data = $dbq->fetchrow_array; + # Check for an unusual issue. + if (!defined $data[1]) { notice($src->{svr}, $src->{nick}, trans('An error occurred').'. Quote might not exist.'); return; } + # Send it back. privmsg($src->{svr}, $src->{chan}, "\002Submitted by\002 $data[1] \002on\002 ".POSIX::strftime('%F', localtime($data[2]))." \002at\002 ".POSIX::strftime('%I:%M %p', localtime($data[2]))); privmsg($src->{svr}, $src->{chan}, $data[3]);