X-LIST-KEYS crash
Hi,
When using X-LIST-KEYS command, a nil pointer exception occurs :
undefined method `map' for nil:NilClass
schleuder-3.1.2/lib/schleuder/plugins/key_management.rb:44:in `list_keys'
Looking into the code, I don't understand what's the purpose of the arguments
parameter of self.list_keys
def self.list_keys(arguments, list, mail)
args = arguments.presence
args.map do |argument|
...
end.join("\n\n")
end
On call, it equals to []
, and then, .presence
returns nil
, which cause the crash.
Change code to
def self.list_keys(arguments, list, mail)
list.gpg.keys.map(&:to_s).join("\n\n")
end
seems working and fixes the crash, but I don't understand the real impact of this change.
Edited by aeris