Fix error when passing no names
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
IamTheFij 2022-11-16 09:52:29 -08:00
parent ed3689eae1
commit 57e933c20d

View File

@ -136,6 +136,10 @@ func FilterJobs(jobs []Job, names []string) ([]Job, error) {
} }
func runBackupJobs(jobs []Job, names string) error { func runBackupJobs(jobs []Job, names string) error {
if names == "" {
return nil
}
namesSlice := strings.Split(names, ",") namesSlice := strings.Split(names, ",")
if len(namesSlice) == 0 { if len(namesSlice) == 0 {
@ -153,6 +157,10 @@ func runBackupJobs(jobs []Job, names string) error {
} }
func runRestoreJobs(jobs []Job, names string) error { func runRestoreJobs(jobs []Job, names string) error {
if names == "" {
return nil
}
namesSlice := strings.Split(names, ",") namesSlice := strings.Split(names, ",")
if len(namesSlice) == 0 { if len(namesSlice) == 0 {