Skip to content

Commit

Permalink
Merge pull request #416 from duck-im/main
Browse files Browse the repository at this point in the history
fix(client): fix type assertion panic error
  • Loading branch information
yedf2 authored May 15, 2023
2 parents e70f28f + 1b296ec commit 2371a98
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/workflow/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@ func (wf *Workflow) DoXa(dbConf dtmcli.DBConf, fn func(db *sql.DB) ([]byte, erro
// Interceptor is the middleware for workflow to capture grpc call result
func Interceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
logger.Debugf("grpc client calling: %s%s %v", cc.Target(), method, dtmimp.MustMarshalString(req))
wf, _ := ctx.Value(wfMeta{}).(*Workflow)
if wf == nil {
wfVal := ctx.Value(wfMeta{})
if wfVal == nil {
return invoker(ctx, method, req, reply, cc, opts...)
}

wf, _ := wfVal.(*Workflow)
origin := func() error {
ctx1 := dtmgimp.TransInfo2Ctx(ctx, wf.Gid, wf.TransType, wf.currentBranch, wf.currentOp, wf.Dtm)
err := invoker(ctx1, method, req, reply, cc, opts...)
Expand Down

0 comments on commit 2371a98

Please # to comment.