diff options
Diffstat (limited to 'app/helpers/icons_helper.rb')
-rw-r--r-- | app/helpers/icons_helper.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb index b79766e3a65..cacb4113cb2 100644 --- a/app/helpers/icons_helper.rb +++ b/app/helpers/icons_helper.rb @@ -42,7 +42,7 @@ module IconsHelper end def sprite_icon(icon_name, size: nil, css_class: nil) - unless known_sprites.include?(icon_name) + if known_sprites&.exclude?(icon_name) exception = ArgumentError.new("#{icon_name} is not a known icon in @gitlab-org/gitlab-svg") Gitlab::Sentry.track_and_raise_for_dev_exception(exception) end @@ -156,6 +156,8 @@ module IconsHelper private def known_sprites + return if Rails.env.production? + @known_sprites ||= JSON.parse(File.read(Rails.root.join('node_modules/@gitlab/svgs/dist/icons.json')))['icons'] end end |