do not delete an empty set of preferences (#26172)

This commit is contained in:
Jesse Hallam 2024-02-09 10:59:05 -04:00 committed by GitHub
parent 63f8991960
commit 7e419e98ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1076,6 +1076,10 @@ func (s *MmctlE2ETestSuite) cleanUpPreferences(userID string) {
preferences, _, err := s.th.SystemAdminClient.GetPreferences(context.Background(), userID)
s.NoError(err)
if len(preferences) == 0 {
return
}
_, err = s.th.SystemAdminClient.DeletePreferences(context.Background(), userID, preferences)
s.NoError(err)
}