Ver Fonte

fix bug

rdluck há 4 anos atrás
pai
commit
4a6778c7bd
1 ficheiros alterados com 3 adições e 2 exclusões
  1. 3 2
      controllers/article.go

+ 3 - 2
controllers/article.go

@@ -74,7 +74,6 @@ func (this *ArticleController) Detail() {
 		}
 		fmt.Println(detail.Department)
 
-
 		detail.Body = html.UnescapeString(detail.Body)
 		detail.Abstract = html.UnescapeString(detail.Abstract)
 		if companyPermission == "" {
@@ -384,7 +383,9 @@ func (this *ArticleCommonController) Detail() {
 	} else {
 		resp.HasPermission = 1
 	}
-	detail.Body = html.UnescapeString(detail.Body)
+	if detail != nil {
+		detail.Body = html.UnescapeString(detail.Body)
+	}
 	resp.Detail = detail
 	br.Ret = 200
 	br.Success = true