From 7640676d0bd7f09e52e645c454b7fed8eb937c20 Mon Sep 17 00:00:00 2001 From: "mozilla%colinogilvie.co.uk" <> Date: Wed, 17 May 2006 05:08:30 +0000 Subject: Bug 337747: config.cgi fails with an SQL error in Bugzilla::Keyword with no keywords defined Patch by Colin Ogilvie ; r=mkanat; a=justdave --- Bugzilla/Keyword.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Bugzilla/Keyword.pm b/Bugzilla/Keyword.pm index fb2e3ae66..946d43c14 100644 --- a/Bugzilla/Keyword.pm +++ b/Bugzilla/Keyword.pm @@ -82,7 +82,7 @@ sub new_from_list { my $dbh = Bugzilla->dbh; my $keywords; - if ($id_list) { + if (@$id_list) { my @detainted_ids; foreach my $id (@$id_list) { detaint_natural($id) || @@ -94,9 +94,7 @@ sub new_from_list { "SELECT $columns FROM keyworddefs WHERE id IN (" . join(',', @detainted_ids) . ")", {Slice=>{}}); } else { - ThrowCodeError('bad_arg', - {argument => 'id_list', - function => 'Bugzilla::Keyword::new_from_list'}); + return []; } foreach my $keyword (@$keywords) { -- cgit v1.2.3-24-g4f1b