Browse Source

add err check for unmarshal json

tags/v0.1.0-rc1
juzimao 3 years ago
parent
commit
3154fcfde4
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      pkg/rm/tcc/tcc_resource.go

+ 3
- 1
pkg/rm/tcc/tcc_resource.go View File

@@ -129,7 +129,9 @@ func (t *TCCResourceManager) getBusinessActionContext(xid string, branchID int64
var actionContextMap = make(map[string]interface{}, 2)
if len(applicationData) > 0 {
var tccContext map[string]interface{}
json.Unmarshal(applicationData, &tccContext)
if err := json.Unmarshal(applicationData, &tccContext); err != nil {
panic("application data failed to unmarshl as json")
}
if v, ok := tccContext[common.ActionContext]; ok {
actionContextMap = v.(map[string]interface{})
}


Loading…
Cancel
Save