summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-10-03 15:32:32 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-04 22:49:42 +0200
commit67815272dceb971c03bea3490ec26529b48a52b4 (patch)
tree455f30ba7fa73b94844e5ed36041d61c43f6e92b /app
parent167fd71348d145c6fee953004bf77ceebf6efb1e (diff)
downloadgitlab-ce-67815272dceb971c03bea3490ec26529b48a52b4.tar.gz
Return an empty array when no matches are found
Diffstat (limited to 'app')
-rw-r--r--app/models/concerns/group_descendant.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/concerns/group_descendant.rb b/app/models/concerns/group_descendant.rb
index f37d23e615e..11f092db2ae 100644
--- a/app/models/concerns/group_descendant.rb
+++ b/app/models/concerns/group_descendant.rb
@@ -6,7 +6,7 @@ module GroupDescendant
def self.build_hierarchy(descendants, hierarchy_top = nil)
descendants = Array.wrap(descendants)
- return if descendants.empty?
+ return [] if descendants.empty?
unless descendants.all? { |hierarchy| hierarchy.is_a?(GroupDescendant) }
raise ArgumentError.new('element is not a hierarchy')