Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Fix npe when webhook url conflicts

天舟a0c1e16d39c1
diff --git a/server/project_hook.go b/server/project_hook.go
index 73299fef5d..5c67470679 100644
--- a/server/project_hook.go
+++ b/server/project_hook.go
@@ -57,7 +57,7 @@ func (s *Server) registerProjectHookRoutes(g *echo.Group) {
hook, err := s.ProjectHookService.CreateProjectHook(context.Background(), hookCreate)
if err != nil {
if bytebase.ErrorCode(err) == bytebase.ECONFLICT {
- return echo.NewHTTPError(http.StatusConflict, fmt.Sprintf("Webhook url already exists in the project: %s", hook.URL))
+ return echo.NewHTTPError(http.StatusConflict, fmt.Sprintf("Webhook url already exists in the project: %s", hookCreate.URL))
}
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create project webhook").SetInternal(err)
}