summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authordklawren <dklawren@users.noreply.github.com>2018-07-24 18:39:02 +0200
committerGitHub <noreply@github.com>2018-07-24 18:39:02 +0200
commit7ded28be567fd52b2ab752c30203e59f307ebdcd (patch)
tree15822d31450c63414ae6acbe2460315af8394606 /extensions
parent345e686485e484e087ea58c988e4831209c39554 (diff)
downloadbugzilla-7ded28be567fd52b2ab752c30203e59f307ebdcd.tar.gz
bugzilla-7ded28be567fd52b2ab752c30203e59f307ebdcd.tar.xz
Bug 1477894 - get_attachment_revisions() should be returning an empty list, instead of a list of [0]
Diffstat (limited to 'extensions')
-rw-r--r--extensions/PhabBugz/lib/Revision.pm2
-rw-r--r--extensions/PhabBugz/lib/Util.pm3
2 files changed, 4 insertions, 1 deletions
diff --git a/extensions/PhabBugz/lib/Revision.pm b/extensions/PhabBugz/lib/Revision.pm
index 900454220..4e82fa500 100644
--- a/extensions/PhabBugz/lib/Revision.pm
+++ b/extensions/PhabBugz/lib/Revision.pm
@@ -93,6 +93,8 @@ sub new_from_query {
: "";
return $class->new($result);
}
+
+ return undef;
}
sub BUILDARGS {
diff --git a/extensions/PhabBugz/lib/Util.pm b/extensions/PhabBugz/lib/Util.pm
index 214bc3fb7..99668289a 100644
--- a/extensions/PhabBugz/lib/Util.pm
+++ b/extensions/PhabBugz/lib/Util.pm
@@ -146,9 +146,10 @@ sub get_attachment_revisions {
my @revisions;
foreach my $revision_id (@revision_ids) {
- push @revisions, Bugzilla::Extension::PhabBugz::Revision->new_from_query({
+ my $revision = Bugzilla::Extension::PhabBugz::Revision->new_from_query({
ids => [ $revision_id ]
});
+ push @revisions, $revision if $revision;
}
return \@revisions;