diff --git a/lib/mpw/config.rb b/lib/mpw/config.rb index b504c2a..148ecf1 100644 --- a/lib/mpw/config.rb +++ b/lib/mpw/config.rb @@ -88,9 +88,9 @@ class Config # expire -> the time of expire to GPG key # @rtrn: true if the GPG key is create, else false def setup_gpg_key(password, name, length = 4096, expire = 0) - if name.nil? or name.empty? + if name.to_s.empty? raise "#{I18n.t('error.config.genkey_gpg.name')}" - elsif password.nil? or password.empty? + elsif password.to_s.empty? raise "#{I18n.t('error.config.genkey_gpg.password')}" end