summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/provider/user/mac.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider/user/mac.rb b/lib/chef/provider/user/mac.rb
index 8e5b3d1cf3..838dca7886 100644
--- a/lib/chef/provider/user/mac.rb
+++ b/lib/chef/provider/user/mac.rb
@@ -48,7 +48,7 @@ class Chef
if user_plist
current_resource.uid(user_plist[:uid][0])
current_resource.gid(user_plist[:gid][0])
- current_resource.home(user_plist[:home][0])
+ current_resource.home(user_plist[:home]&.first) # use &.first since home can be nil
current_resource.shell(user_plist[:shell]&.first) # use &.first since shell can be nil
current_resource.comment(user_plist[:comment][0])