diff options
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/provider/osx_profile.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/chef/provider/osx_profile.rb b/lib/chef/provider/osx_profile.rb index 071b4b0462..dccda49e1d 100644 --- a/lib/chef/provider/osx_profile.rb +++ b/lib/chef/provider/osx_profile.rb @@ -54,10 +54,13 @@ class Chef @new_resource.profile_name end - current_profile = all_profiles["_computerlevel"].find { - |item| item["ProfileIdentifier"] == - @new_profile_identifier - } + if all_profiles.empty? + current_profile = nil + else + current_profile = all_profiles["_computerlevel"].find do |item| + item["ProfileIdentifier"] == @new_profile_identifier + end + end @current_resource.profile(current_profile) end |