mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
chore(nil): remove unnecessary nil checks EE-4847 (#8254)
This commit is contained in:
parent
e529327851
commit
137ce37096
8 changed files with 15 additions and 18 deletions
|
@ -69,7 +69,7 @@ func (payload *edgeJobCreateFromFileContentPayload) Validate(r *http.Request) er
|
|||
return errors.New("invalid cron expression")
|
||||
}
|
||||
|
||||
if (payload.Endpoints == nil || len(payload.Endpoints) == 0) && (payload.EdgeGroups == nil || len(payload.EdgeGroups) == 0) {
|
||||
if len(payload.Endpoints) == 0 && len(payload.EdgeGroups) == 0 {
|
||||
return errors.New("no environments or groups have been provided")
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ func (payload *edgeJobCreateFromFilePayload) Validate(r *http.Request) error {
|
|||
}
|
||||
payload.EdgeGroups = edgeGroups
|
||||
|
||||
if (payload.Endpoints == nil || len(payload.Endpoints) == 0) && (payload.EdgeGroups == nil || len(payload.EdgeGroups) == 0) {
|
||||
if len(payload.Endpoints) == 0 && len(payload.EdgeGroups) == 0 {
|
||||
return errors.New("no environments or groups have been provided")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue