From 1fbecd465ffbf9a74bf251935ec32e0c7fe130cf Mon Sep 17 00:00:00 2001 From: Leon Zhang Date: Mon, 21 Jan 2019 11:27:19 +0800 Subject: [PATCH] fix loadExternalResource fail cause panic --- common/markdown.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/markdown.go b/common/markdown.go index 55d91c2..7573e08 100644 --- a/common/markdown.go +++ b/common/markdown.go @@ -44,7 +44,7 @@ func MarkdownEscape(str string) string { return str } -// +// loadExternalResource load js/css resource from http[s] url func loadExternalResource(resource string) string { var content string var body []byte @@ -59,6 +59,7 @@ func loadExternalResource(resource string) string { } } else { Log.Debug("http.Get %s Error: %v", resource, err) + return "" } defer resp.Body.Close() } else { -- GitLab