diff options
author | Frédéric Buclin <LpSolit@netscape.net> | 2017-06-05 00:40:23 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@netscape.net> | 2017-06-05 00:40:23 +0200 |
commit | 849e1858d699012cffa42912b7db75b23077db69 (patch) | |
tree | 7154c442ef839997803340725339ce72879521b3 /extensions | |
parent | d695b1d38447edae0558829766726d9d99489689 (diff) | |
download | bugs-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
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/Mageia/Extension.pm | 11 |
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 |