Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e72b939

Browse files
committed
bugfix
1 parent f473bf9 commit e72b939

File tree

1 file changed

+1
-1
lines changed
  • websites/code/studygolang/src/controller

1 file changed

+1
-1
lines changed

websites/code/studygolang/src/controller/article.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func ArticleDetailHandler(rw http.ResponseWriter, req *http.Request) {
104104
util.Redirect(rw, req, "/articles")
105105
}
106106

107-
if article.Id == 0 || article.Status == model.StatusOffline {
107+
if article == nil || article.Id == 0 || article.Status == model.StatusOffline {
108108
util.Redirect(rw, req, "/articles")
109109
}
110110

0 commit comments

Comments
 (0)