aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2012-12-19 23:40:51 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2012-12-19 23:40:51 +0100
commite79713b240970bd0c1b394fcc69bd66e15e82641 (patch)
tree3a0c2582b22d25eecd1e2ad0b387d1a0ac95dd0d
parentBug 813628 - New extension hook for Bugzilla::Bug::update called bug_start_of... (diff)
downloadbugzilla-e79713b240970bd0c1b394fcc69bd66e15e82641.tar.gz
bugzilla-e79713b240970bd0c1b394fcc69bd66e15e82641.tar.bz2
bugzilla-e79713b240970bd0c1b394fcc69bd66e15e82641.zip
Bug 819330: Bugzilla crashes when cloning a bug if the CC list is empty
r=dkl a=LpSolit
-rw-r--r--Bugzilla/Bug.pm2
-rw-r--r--Bugzilla/WebService/Bug.pm2
-rwxr-xr-xenter_bug.cgi2
3 files changed, 2 insertions, 4 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 6e37b19f1..229a24003 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -3187,8 +3187,6 @@ sub cc {
ORDER BY profiles.login_name},
undef, $self->bug_id);
- $self->{'cc'} = undef if !scalar(@{$self->{'cc'}});
-
return $self->{'cc'};
}
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index f4181c336..71b2e52cd 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -877,7 +877,7 @@ sub _bug_to_hash {
$item{'blocks'} = \@blocks;
}
if (filter_wants $params, 'cc') {
- my @cc = map { $self->type('string', $_) } @{ $bug->cc || [] };
+ my @cc = map { $self->type('string', $_) } @{ $bug->cc };
$item{'cc'} = \@cc;
}
if (filter_wants $params, 'creator') {
diff --git a/enter_bug.cgi b/enter_bug.cgi
index 7a8cebf43..1f80501d5 100755
--- a/enter_bug.cgi
+++ b/enter_bug.cgi
@@ -208,7 +208,7 @@ if ($cloned_bug_id) {
$vars->{'deadline'} = $cloned_bug->deadline;
$vars->{'estimated_time'} = $cloned_bug->estimated_time;
- if (defined $cloned_bug->cc) {
+ if (scalar @{$cloned_bug->cc}) {
$vars->{'cc'} = join (", ", @{$cloned_bug->cc});
} else {
$vars->{'cc'} = formvalue('cc');