summaryrefslogtreecommitdiff
path: root/lib/chef/chef_fs/file_system/base_fs_object.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/chef_fs/file_system/base_fs_object.rb')
-rw-r--r--lib/chef/chef_fs/file_system/base_fs_object.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/chef/chef_fs/file_system/base_fs_object.rb b/lib/chef/chef_fs/file_system/base_fs_object.rb
index 6f05a0406e..916ab8297d 100644
--- a/lib/chef/chef_fs/file_system/base_fs_object.rb
+++ b/lib/chef/chef_fs/file_system/base_fs_object.rb
@@ -95,9 +95,10 @@ class Chef
# directly perform a network request to retrieve the y.json data bag. No
# network request was necessary to retrieve
def child(name)
- (can_have_child?(name, true) || can_have_child?(name, false)) ?
- make_child_entry(name) :
- NonexistentFSObject.new(name, self)
+ if can_have_child?(name, true) || can_have_child?(name, false)
+ result = make_child_entry(name)
+ end
+ result || NonexistentFSObject.new(name, self)
end
# Override children to report your *actual* list of children as an array.