From f4b1e3701b390139af101cac45be9f772f824792 Mon Sep 17 00:00:00 2001 From: Nick Zadrozny Date: Fri, 3 Jun 2011 15:48:13 -0500 Subject: [PATCH] Gracefully handle the 'garbage in' of an empty .foreman file. --- lib/foreman/cli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/foreman/cli.rb b/lib/foreman/cli.rb index 2ece1ae..cedd41a 100644 --- a/lib/foreman/cli.rb +++ b/lib/foreman/cli.rb @@ -86,7 +86,7 @@ private ###################################################################### def options original_options = super return original_options unless File.exists?(".foreman") - defaults = YAML::load_file(".foreman") + defaults = YAML::load_file(".foreman") || {} Thor::CoreExt::HashWithIndifferentAccess.new(defaults.merge(original_options)) end