diff options
author | Kostiantyn Kahanskyi <kostiantyn.kahanskyi@googlemail.com> | 2014-09-12 14:58:04 +0200 |
---|---|---|
committer | Kostiantyn Kahanskyi <kostiantyn.kahanskyi@googlemail.com> | 2014-09-12 15:09:00 +0200 |
commit | 4bf9d1938bb144ef2a6c3d03a2d01add62e90114 (patch) | |
tree | c881ff8cf675795aa9057957dd3f6615820b4eb1 /activesupport/lib | |
parent | b259b06e73a44f87654d26759b0a679e1ecc069c (diff) | |
download | rails-4bf9d1938bb144ef2a6c3d03a2d01add62e90114.tar.gz rails-4bf9d1938bb144ef2a6c3d03a2d01add62e90114.tar.bz2 rails-4bf9d1938bb144ef2a6c3d03a2d01add62e90114.zip |
MessageVerifier raises an appropriate exception if the secret is nil
Otherwise this will lead to another error later on
when generating a signature:
TypeError (no implicit conversion of nil into String).
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/message_verifier.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/message_verifier.rb b/activesupport/lib/active_support/message_verifier.rb index 8e6e1dcfeb..41e2e5a88f 100644 --- a/activesupport/lib/active_support/message_verifier.rb +++ b/activesupport/lib/active_support/message_verifier.rb @@ -27,6 +27,7 @@ module ActiveSupport class InvalidSignature < StandardError; end def initialize(secret, options = {}) + raise ArgumentError, 'Secret should not be nil.' if secret.nil? @secret = secret @digest = options[:digest] || 'SHA1' @serializer = options[:serializer] || Marshal |