From a13129147376eabb9210ebad15d03173a36936dd Mon Sep 17 00:00:00 2001 From: markgibbons Date: Fri, 29 Sep 2017 19:54:19 -0700 Subject: invites_sort_fail: Clean the invites array before sorting it Sort threw an error trying to compare nil with a string while running knife ec backup. This change deletes the nil entries before sorting. Signed-off-by: markgibbons --- lib/chef/chef_fs/data_handler/organization_invites_data_handler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chef/chef_fs/data_handler/organization_invites_data_handler.rb b/lib/chef/chef_fs/data_handler/organization_invites_data_handler.rb index c5a5f873c5..7ae08823b8 100644 --- a/lib/chef/chef_fs/data_handler/organization_invites_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/organization_invites_data_handler.rb @@ -5,7 +5,7 @@ class Chef module DataHandler class OrganizationInvitesDataHandler < DataHandlerBase def normalize(invites, entry) - invites.map { |invite| invite.is_a?(Hash) ? invite["username"] : invite }.sort.uniq + invites.map { |invite| invite.is_a?(Hash) ? invite["username"] : invite }.compact.sort.uniq end def minimize(invites, entry) -- cgit v1.2.1