Skip to content

Commit c437a55

Browse files
committed
Handle context.warden being nil
1 parent b359fc9 commit c437a55

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/graphql/schema/warden.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ class Schema
3838
# @api private
3939
class Warden
4040
def self.from_context(context)
41-
context.warden # this might be a hash which won't respond to this
42-
rescue
41+
context.warden || PassThruWarden
42+
rescue NoMethodError
43+
# this might be a hash which won't respond to #warden
4344
PassThruWarden
4445
end
4546

0 commit comments

Comments
 (0)