mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-04 13:52:26 +08:00
fix out of range about MapArticels
This commit is contained in:
4
front.go
4
front.go
@@ -119,8 +119,8 @@ func HandleArchivesPage(c *gin.Context) {
|
||||
|
||||
func HandleArticlePage(c *gin.Context) {
|
||||
path := c.Param("slug")
|
||||
artc := Ei.MapArticles[path[0:strings.Index(path, ".")]]
|
||||
if artc == nil {
|
||||
index := strings.Index(path, ".")
|
||||
if index < 0 || Ei.MapArticles[path[0:index]] == nil {
|
||||
HandleNotFound(c)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user