This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/answer.git


The following commit(s) were added to refs/heads/dev by this push:
     new d48b633b fix: get tag with page nil pointer error
d48b633b is described below

commit d48b633baa8a55edd54bf9c84e5e42ae78e3bffb
Author: Young Xu <[email protected]>
AuthorDate: Fri Mar 28 21:29:43 2025 +0800

    fix: get tag with page nil pointer error
    
    Signed-off-by: Young Xu <[email protected]>
---
 internal/controller/tag_controller.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/internal/controller/tag_controller.go 
b/internal/controller/tag_controller.go
index 1cebf9d4..8326da1c 100644
--- a/internal/controller/tag_controller.go
+++ b/internal/controller/tag_controller.go
@@ -274,6 +274,10 @@ func (tc *TagController) GetTagWithPage(ctx *gin.Context) {
        req.UserID = middleware.GetLoginUserIDFromContext(ctx)
 
        resp, err := tc.tagService.GetTagWithPage(ctx, req)
+       if err != nil {
+               handler.HandleResponse(ctx, err, nil)
+               return
+       }
        if pager.ValPageOutOfRange(resp.Count, req.Page, req.PageSize) {
                handler.HandleResponse(ctx, 
errors.NotFound(reason.RequestFormatError), nil)
                return

Reply via email to