fix: bt fetcher restore

This commit is contained in:
liwei committed 2023-02-06 22:21:25 +08:00
1 parent 027d29e834
commit 2e5fd3017c
3 files changed
+12 -4

No files matched your search

+3 -1
View File
@@ -21,5 +21,7 @@ func WriteJsonOk(w http.ResponseWriter, v any) {
func WriteJson(w http.ResponseWriter, code int, v any) {
w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.WriteHeader(code)
json.NewEncoder(w).Encode(v)
if v != nil {
json.NewEncoder(w).Encode(v)
}
}