diff options
-rw-r--r-- | lib/chef/provider/osx_profile.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/chef/provider/osx_profile.rb b/lib/chef/provider/osx_profile.rb index 6ac67e0560..6c55a42817 100644 --- a/lib/chef/provider/osx_profile.rb +++ b/lib/chef/provider/osx_profile.rb @@ -54,11 +54,10 @@ class Chef @new_resource.profile_name end - if all_profiles.empty? - current_profile = nil - else - current_profile = all_profiles["_computerlevel"].find do |item| - item["ProfileIdentifier"] == @new_profile_identifier + current_profile = nil + if all_profiles && !all_profiles.empty? + current_profile = all_profiles['_computerlevel'].find do |item| + item['ProfileIdentifier'] == @new_profile_identifier end end @current_resource.profile(current_profile) |