summaryrefslogtreecommitdiffstats
path: root/store/sqlstore
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-12-20 19:29:43 +0000
committerGitHub <noreply@github.com>2017-12-20 19:29:43 +0000
commitdcc20167557aa1f85943410a898baf62f142bfde (patch)
treeabd3d6a35ee0e9437c48149f81cb46e64cb6c635 /store/sqlstore
parent0a2ffbc73797c5e95450d6ae65e4dc960b688da7 (diff)
downloadchat-dcc20167557aa1f85943410a898baf62f142bfde.tar.gz
chat-dcc20167557aa1f85943410a898baf62f142bfde.tar.bz2
chat-dcc20167557aa1f85943410a898baf62f142bfde.zip
PLT-8354: Fix user search error when terms end up as empty space. (#7984)
Diffstat (limited to 'store/sqlstore')
-rw-r--r--store/sqlstore/user_store.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/store/sqlstore/user_store.go b/store/sqlstore/user_store.go
index 09b1ce1be..5ecc1fdda 100644
--- a/store/sqlstore/user_store.go
+++ b/store/sqlstore/user_store.go
@@ -1078,7 +1078,7 @@ func (us SqlUserStore) performSearch(searchQuery string, term string, options ma
searchQuery = strings.Replace(searchQuery, "INACTIVE_CLAUSE", "AND Users.DeleteAt = 0", 1)
}
- if term == "" {
+ if strings.TrimSpace(term) == "" {
searchQuery = strings.Replace(searchQuery, "SEARCH_CLAUSE", "", 1)
} else {
isPostgreSQL := us.DriverName() == model.DATABASE_DRIVER_POSTGRES