summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Flag.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm
index a65a8268b..6266b0c0c 100644
--- a/Bugzilla/Flag.pm
+++ b/Bugzilla/Flag.pm
@@ -228,12 +228,12 @@ sub match {
# If the caller specified only bug or attachment flags,
# limit the query to those kinds of flags.
if (my $type = delete $criteria->{'target_type'}) {
- if ($type eq 'attachment') {
- $criteria->{'attach_id'} = NOT_NULL;
- }
- else {
+ if ($type eq 'bug') {
$criteria->{'attach_id'} = IS_NULL;
}
+ elsif (!defined $criteria->{'attach_id'}) {
+ $criteria->{'attach_id'} = NOT_NULL;
+ }
}
# Flag->snapshot() calls Flag->match() with bug_id and attach_id
# as hash keys, even if attach_id is undefined.