lib/oauthenticator/signed_request.rb in oauthenticator-1.4.0 vs lib/oauthenticator/signed_request.rb in oauthenticator-1.4.1

- old
+ new

@@ -91,10 +91,10 @@ # # {'attribute1': ['messageA', 'messageB'], 'attribute2': ['messageC']} # # @return [nil, Hash<String, Array<String>>] either nil or a hash of errors def errors - return @errors if instance_variables.any? { |ivar| ivar.to_s == '@errors' } + return @errors if instance_variable_defined?('@errors') @errors = catch(:errors) do if authorization.nil? throw(:errors, {'Authorization' => ["Authorization header is missing"]}) elsif authorization !~ /\S/ throw(:errors, {'Authorization' => ["Authorization header is blank"]})