summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-08-06 14:21:42 -0700
committerJohn Keiser <john@johnkeiser.com>2015-08-07 14:19:31 -0700
commit6e3b0f50ad8a599ef419928faa9626ee0b5b8082 (patch)
treeb4b83e9d51b665c5180dbdbdde392b564fd7eba6
parent0ad6e62acd183d9bbc9650de2c0d54ec4124626c (diff)
downloadchef-6e3b0f50ad8a599ef419928faa9626ee0b5b8082.tar.gz
Don't return nil from make_child_entry
-rw-r--r--lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb b/lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb
index d03baf91fe..48b1d200db 100644
--- a/lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb
+++ b/lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb
@@ -72,7 +72,7 @@ class Chef
def children
@children ||= begin
- result = child_paths.keys.sort.map { |name| make_child_entry(name) }.select { |child| !child.nil? }
+ result = child_paths.keys.sort.map { |name| make_child_entry(name) }.select { |child| child.exists? }
result += root_dir.children.select { |c| CHILDREN.include?(c.name) } if root_dir
result.sort_by { |c| c.name }
end
@@ -153,7 +153,7 @@ class Chef
File.exists?(path)
end
if paths.size == 0
- return nil
+ return NonexistentFSObject.new(name, self)
end
if name == 'cookbooks'
dirs = paths.map { |path| ChefRepositoryFileSystemCookbooksDir.new(name, self, path) }