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
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/mutations/snippets/base.rb')
-rw-r--r--app/graphql/mutations/snippets/base.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/graphql/mutations/snippets/base.rb b/app/graphql/mutations/snippets/base.rb
index 9dc6d49774e..c8cc721b2e0 100644
--- a/app/graphql/mutations/snippets/base.rb
+++ b/app/graphql/mutations/snippets/base.rb
@@ -15,6 +15,8 @@ module Mutations
end
def authorized_resource?(snippet)
+ return false if snippet.nil?
+
Ability.allowed?(context[:current_user], ability_for(snippet), snippet)
end