aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@netscape.net>2017-06-05 00:40:23 +0200
committerFrédéric Buclin <LpSolit@netscape.net>2017-06-05 00:40:23 +0200
commit849e1858d699012cffa42912b7db75b23077db69 (patch)
tree7154c442ef839997803340725339ce72879521b3
parentd695b1d38447edae0558829766726d9d99489689 (diff)
downloadbugs-849e1858d699012cffa42912b7db75b23077db69.tar
bugs-849e1858d699012cffa42912b7db75b23077db69.tar.gz
bugs-849e1858d699012cffa42912b7db75b23077db69.tar.bz2
bugs-849e1858d699012cffa42912b7db75b23077db69.tar.xz
bugs-849e1858d699012cffa42912b7db75b23077db69.zip
Make sure $args->{changes} exists to not autovivify it when no changes are made
-rw-r--r--extensions/Mageia/Extension.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/extensions/Mageia/Extension.pm b/extensions/Mageia/Extension.pm
index 819838b95..60ca57f00 100644
--- a/extensions/Mageia/Extension.pm
+++ b/extensions/Mageia/Extension.pm
@@ -49,10 +49,15 @@ sub bug_end_of_update {
my $dbh = Bugzilla->dbh;
my $user = Bugzilla->user;
- # If a user enters 'validated_update' as keyword,
- # automatically CC sysadmin-bugs@ml.mageia.org.
- my $new_keywords_str = $args->{changes}->{keywords}->[1];
+ my $new_keywords_str;
+ # Call exists to avoid autovivification of $args->{changes} if it does not exist.
+ # Else $bug->update() always sees the bug as being edited.
+ if (exists $args->{changes} && exists $args->{changes}->{keywords}) {
+ $new_keywords_str = $args->{changes}->{keywords}->[1];
+ }
+ # If a user enters 'validated_update' as keyword, automatically
+ # CC sysadmin-bugs@ml.mageia.org.
if ($new_keywords_str) {
my @new_keywords = split(/[,\s]+/, $new_keywords_str);
if (grep { $_ eq 'validated_update' } @new_keywords