lib/lockr/http/httplockrinit.rb in lockr-0.5.1 vs lib/lockr/http/httplockrinit.rb in lockr-0.5.2
- old
+ new
@@ -11,11 +11,14 @@
puts 'Please provide a keyfile'
raise ArgumentError
end
configfile = Configuration.new()
- cfg = configfile.config[:lockr]
- options[:vault] = File.expand_path(cfg[:vault]) if options[:vault] == 'vault.yaml'
+ cfg = nil
+ if configfile.config
+ cfg = configfile.config[:lockr]
+ end
+ options[:vault] = File.expand_path(cfg[:vault]) if options[:vault] == 'vault.yaml' and cfg != nil
@pwdmgr = PasswordManager.new( options[:keyfile], options[:vault])
@load_browser = options[:browser]
end
\ No newline at end of file