summaryrefslogtreecommitdiff
path: root/contrib/importers
diff options
context:
space:
mode:
authorBrian Tomlinson <darthlukan@gmail.com>2015-10-20 01:37:10 +0900
committerAlex Sayers <alex.sayers@gmail.com>2015-10-20 02:27:08 +0900
commit85757e99bff29d6fa663a6b291c9047ccce8c6d3 (patch)
tree4824beef12e8506b9b49ad60aa46d7a6af34cfd7 /contrib/importers
parent5daf632af9b78042531631ce1ab6716a3b678de0 (diff)
downloadpass-85757e99bff29d6fa663a6b291c9047ccce8c6d3.tar.gz
pass-85757e99bff29d6fa663a6b291c9047ccce8c6d3.tar.bz2
pass-85757e99bff29d6fa663a6b291c9047ccce8c6d3.zip
lastpass2pass.rb: Check for nil names/groupings
In particular, people were encountering exceptions when `empty?` was called on a `nil` grouping.
Diffstat (limited to '')
-rwxr-xr-xcontrib/importers/lastpass2pass.rb6
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}"