diff options
author | Brian Tomlinson <darthlukan@gmail.com> | 2015-10-20 01:37:10 +0900 |
---|---|---|
committer | Alex Sayers <alex.sayers@gmail.com> | 2015-10-20 02:27:08 +0900 |
commit | 85757e99bff29d6fa663a6b291c9047ccce8c6d3 (patch) | |
tree | 4824beef12e8506b9b49ad60aa46d7a6af34cfd7 /contrib | |
parent | 5daf632af9b78042531631ce1ab6716a3b678de0 (diff) |
lastpass2pass.rb: Check for nil names/groupings
In particular, people were encountering exceptions when `empty?` was
called on a `nil` grouping.
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/importers/lastpass2pass.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/importers/lastpass2pass.rb b/contrib/importers/lastpass2pass.rb index 654101b..bf46c8c 100755 --- a/contrib/importers/lastpass2pass.rb +++ b/contrib/importers/lastpass2pass.rb @@ -53,7 +53,7 @@ class Record def name s = "" s << @grouping + "/" unless @grouping.empty? - s << @name + s << @name unless @name == nil s.gsub(/ /, "_").gsub(/'/, "") end @@ -99,10 +99,10 @@ entries.each do |e| password = args.shift fav = args.pop grouping = args.pop - grouping = DEFAULT_GROUP if grouping.empty? + grouping = DEFAULT_GROUP if grouping == nil name = args.pop extra = args.join(",")[1...-1] - + records << Record.new(name, url, username, password, extra, grouping, fav) end puts "Records parsed: #{records.length}" |