提交 1fbecd46 编写于 作者: martianzhang's avatar martianzhang

fix loadExternalResource fail cause panic

上级 5ac868ee
...@@ -44,7 +44,7 @@ func MarkdownEscape(str string) string { ...@@ -44,7 +44,7 @@ func MarkdownEscape(str string) string {
return str return str
} }
// // loadExternalResource load js/css resource from http[s] url
func loadExternalResource(resource string) string { func loadExternalResource(resource string) string {
var content string var content string
var body []byte var body []byte
...@@ -59,6 +59,7 @@ func loadExternalResource(resource string) string { ...@@ -59,6 +59,7 @@ func loadExternalResource(resource string) string {
} }
} else { } else {
Log.Debug("http.Get %s Error: %v", resource, err) Log.Debug("http.Get %s Error: %v", resource, err)
return ""
} }
defer resp.Body.Close() defer resp.Body.Close()
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册