diff --git a/engine/api/workflow/dao.go b/engine/api/workflow/dao.go index 0a6c5c5957..46854796c1 100644 --- a/engine/api/workflow/dao.go +++ b/engine/api/workflow/dao.go @@ -1089,9 +1089,7 @@ func checkHooks(ctx context.Context, db gorp.SqlExecutor, w *sdk.Workflow, n *sd h2 := n.Hooks[j] if i != j && h.Ref() == h2.Ref() { log.ErrorWithStackTrace(ctx, sdk.NewErrorFrom(sdk.ErrWrongRequest, "invalid workflow: duplicate hook %s", model.Name)) - if !sdk.IsInInt64Array(int64(i), duplicateHookIdx) && !sdk.IsInInt64Array(int64(i), duplicateHookIdx) { - duplicateHookIdx = append(duplicateHookIdx, int64(j)) - } + duplicateHookIdx = append(duplicateHookIdx, int64(j)) } } }