From 85757e99bff29d6fa663a6b291c9047ccce8c6d3 Mon Sep 17 00:00:00 2001 From: Brian Tomlinson Date: Tue, 20 Oct 2015 01:37:10 +0900 Subject: lastpass2pass.rb: Check for nil names/groupings In particular, people were encountering exceptions when `empty?` was called on a `nil` grouping. --- contrib/importers/lastpass2pass.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'contrib') 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}" -- cgit v1.2.3