From 9120cd2c680ba8a700d121d9f3925b5bee3d6a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Fri, 8 Mar 2024 16:35:03 +0800 Subject: [PATCH] fix npe --- common.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common.go b/common.go index c0167e3..2435517 100644 --- a/common.go +++ b/common.go @@ -381,6 +381,12 @@ func (c *common) ToString() string { // // Date : 16:25 2024/3/8 func (c *common) Filter(ignoreFieldList []string, rewriteFieldTable map[string]string) map[string]interface{} { + if nil == ignoreFieldList { + ignoreFieldList = make([]string, 0) + } + if nil == rewriteFieldTable { + rewriteFieldTable = make(map[string]string) + } result := make(map[string]interface{}) ignoreFieldTable := make(map[string]bool) for _, item := range ignoreFieldList {