fix(maputil): prevent nil value overwrite (#1755)

Signed-off-by: zhengbayi <ban11111@qq.com>
Co-authored-by: zhengbayi <zhengbaiyi@sensetime.com>
This commit is contained in:
zebreay
2024-10-25 20:52:05 +08:00
committed by GitHub
co-authored by zhengbayi
parent d1416ec7b4
commit 5837672bfa
2 changed files with 20 additions and 0 deletions
+3
View File
@@ -231,6 +231,9 @@ func MergeMaps(a, b map[string]interface{}) map[string]interface{} {
out[k] = v
}
for k, v := range b {
if v == nil {
continue
}
if v, ok := v.(map[string]interface{}); ok {
if bv, ok := out[k]; ok {
if bv, ok := bv.(map[string]interface{}); ok {