warren830 commented on code in PR #4409:
URL: 
https://github.com/apache/incubator-devlake/pull/4409#discussion_r1104568056


##########
backend/plugins/gitlab/api/remote.go:
##########
@@ -274,25 +274,27 @@ func SearchRemoteScopes(input *plugin.ApiResourceInput) 
(*plugin.ApiResourceOutp
                search = []string{""}
        }
 
+       var p int
+       var err1 error
        page, ok := input.Query["page"]
        if !ok || len(page) == 0 {
-               page = []string{""}
-       }
-
-       p, err1 := strconv.Atoi(page[0])
-       if err1 != nil {
-               return nil, errors.BadInput.Wrap(err1, fmt.Sprintf("failed to 
Atoi page:%s", page[0]))
+               p = 1
+       } else {
+               p, err1 = strconv.Atoi(page[0])
+               if err != nil {
+                       return nil, errors.BadInput.Wrap(err1, 
fmt.Sprintf("failed to Atoi page:%s", page[0]))
+               }

Review Comment:
   if page or pageSize is empty, why do we set it an empty array and use 
strconv.Atoi?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to