MM-31062: Rewrite empty string checks to be more idiomatic (#16587)
https://mattermost.atlassian.net/browse/MM-31062 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1a131b54af
Коммит
6487d0ca91
@@ -559,7 +559,7 @@ func getFilteredUsersStats(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
channelRoles := []string{}
|
||||
if channelRolesString != "" && len(channelID) != 0 {
|
||||
if channelRolesString != "" && channelID != "" {
|
||||
channelRoles, rolesValid = model.CleanRoleNames(strings.Split(channelRolesString, ","))
|
||||
if !rolesValid {
|
||||
c.SetInvalidParam("channelRoles")
|
||||
@@ -567,7 +567,7 @@ func getFilteredUsersStats(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
teamRoles := []string{}
|
||||
if teamRolesString != "" && len(teamID) != 0 {
|
||||
if teamRolesString != "" && teamID != "" {
|
||||
teamRoles, rolesValid = model.CleanRoleNames(strings.Split(teamRolesString, ","))
|
||||
if !rolesValid {
|
||||
c.SetInvalidParam("teamRoles")
|
||||
@@ -673,7 +673,7 @@ func getUsers(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
channelRoles := []string{}
|
||||
if channelRolesString != "" && len(inChannelId) != 0 {
|
||||
if channelRolesString != "" && inChannelId != "" {
|
||||
channelRoles, rolesValid = model.CleanRoleNames(strings.Split(channelRolesString, ","))
|
||||
if !rolesValid {
|
||||
c.SetInvalidParam("channelRoles")
|
||||
@@ -681,7 +681,7 @@ func getUsers(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
teamRoles := []string{}
|
||||
if teamRolesString != "" && len(inTeamId) != 0 {
|
||||
if teamRolesString != "" && inTeamId != "" {
|
||||
teamRoles, rolesValid = model.CleanRoleNames(strings.Split(teamRolesString, ","))
|
||||
if !rolesValid {
|
||||
c.SetInvalidParam("teamRoles")
|
||||
|
||||
Ссылка в новой задаче
Block a user