summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2015-03-08 13:27:06 +0200
committerytti <saku@ytti.fi>2015-03-08 13:27:06 +0200
commitdc9309935ff129d39be985efc78858aeb11e8496 (patch)
treeec88b8860036620352a046e956dbc616e1b9cf8d /lib
parentcb851fdc9bfdeae603f8c56fe5bc69838b01f420 (diff)
parent52d88fa83d7a97292428a744a9d67531b294fd8e (diff)
Merge pull request #87 from brandt/return_nil_on_missing_output_file
Fix: Handle missing output file
Diffstat (limited to 'lib')
-rw-r--r--lib/oxidized/output/file.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/oxidized/output/file.rb b/lib/oxidized/output/file.rb
index 03c878a..38c9917 100644
--- a/lib/oxidized/output/file.rb
+++ b/lib/oxidized/output/file.rb
@@ -33,6 +33,7 @@ class OxidizedFile < Output
IO.readlines File.join(cfg_dir, node)
else
path = Dir.glob File.join(cfg_dir, '**', node) # fetch node in all groups
+ return nil if path[0].nil?
open(path[0], 'r').readlines
end
end