Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-02-02 13:23:05 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2018-02-02 15:17:32 +0300
commit948150f050d14811f6fe1b327387e3c2c1b1fe31 (patch)
treecea5fcebe31e084a58e698e3e802f194883b5ffb /lib
parent8891fbd0a95bd1d2725d6d6187ff4eb21572c3cc (diff)
Avoid error when no restricted levels are defined
When no visibility levels are defined they could sometimes return `nil` instead of an empty array. In this case we want to allow all levels.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/visibility_level.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb
index 6ced06a863d..0b757b2a646 100644
--- a/lib/gitlab/visibility_level.rb
+++ b/lib/gitlab/visibility_level.rb
@@ -60,7 +60,7 @@ module Gitlab
def allowed_levels
restricted_levels = current_application_settings.restricted_visibility_levels
- self.values - restricted_levels
+ self.values - Array(restricted_levels)
end
def closest_allowed_level(target_level)