From 7ded28be567fd52b2ab752c30203e59f307ebdcd Mon Sep 17 00:00:00 2001 From: dklawren Date: Tue, 24 Jul 2018 12:39:02 -0400 Subject: Bug 1477894 - get_attachment_revisions() should be returning an empty list, instead of a list of [0] --- extensions/PhabBugz/lib/Revision.pm | 2 ++ extensions/PhabBugz/lib/Util.pm | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'extensions/PhabBugz') 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; -- cgit v1.2.3-24-g4f1b