diff --git a/pkg/cloudcommon/db/taskman/tasks.go b/pkg/cloudcommon/db/taskman/tasks.go index 47f9f65d34..370c053d24 100644 --- a/pkg/cloudcommon/db/taskman/tasks.go +++ b/pkg/cloudcommon/db/taskman/tasks.go @@ -216,6 +216,10 @@ func (manager *STaskManager) NewParallelTask(ctx context.Context, taskName strin return nil, fmt.Errorf("task %s not found", taskName) } + if len(objs) == 0 { + return nil, fmt.Errorf("failed to do task %s with zero objs", taskName) + } + log.Debugf("number of objs: %d", len(objs)) lockman.LockClass(ctx, objs[0].GetModelManager(), userCred.GetProjectId()) defer lockman.ReleaseClass(ctx, objs[0].GetModelManager(), userCred.GetProjectId())