summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2021-11-15 13:16:11 +0000
committerGitHub <noreply@github.com>2021-11-15 21:16:11 +0800
commitab1379743e812eb1430e4d15a00c3f7b9e759da6 (patch)
tree81dfccc630574b917035842431b4d0e7c938a100 /routers
parent253d9e415813e90543cca8d94112c9e4238d39a4 (diff)
downloadgitea-ab1379743e812eb1430e4d15a00c3f7b9e759da6.tar.gz
gitea-ab1379743e812eb1430e4d15a00c3f7b9e759da6.zip
Fix nil checking on typed interface (#17598)
* Fix nil checking on typed interface - Partially resoles #17596 - Resolves SA4023 errors. - Ensure correctly that typed interface are nil. * Remove unnecessary code `NewBleveIndexer` will never return nil, even on errors. * Patch `NewBleveIndexer` * Fix low-level functions * Remove deadcode * Fix GetSession * Close Elastic search when err isn't nil * Update elastic_search.go Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'routers')
-rw-r--r--routers/web/base.go8
1 files changed, 0 insertions, 8 deletions
diff --git a/routers/web/base.go b/routers/web/base.go
index 16d3192da2..98713bc881 100644
--- a/routers/web/base.go
+++ b/routers/web/base.go
@@ -130,14 +130,6 @@ func Recovery() func(next http.Handler) http.Handler {
log.Error("%v", combinedErr)
sessionStore := session.GetSession(req)
- if sessionStore == nil {
- if setting.IsProd {
- http.Error(w, http.StatusText(500), 500)
- } else {
- http.Error(w, combinedErr, 500)
- }
- return
- }
var lc = middleware.Locale(w, req)
var store = dataStore{