Skip to content

Commit 2371a98

Browse files
authored
Merge pull request #416 from duck-im/main
fix(client): fix type assertion panic error
2 parents e70f28f + 1b296ec commit 2371a98

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

client/workflow/workflow.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,11 @@ func (wf *Workflow) DoXa(dbConf dtmcli.DBConf, fn func(db *sql.DB) ([]byte, erro
235235
// Interceptor is the middleware for workflow to capture grpc call result
236236
func Interceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
237237
logger.Debugf("grpc client calling: %s%s %v", cc.Target(), method, dtmimp.MustMarshalString(req))
238-
wf, _ := ctx.Value(wfMeta{}).(*Workflow)
239-
if wf == nil {
238+
wfVal := ctx.Value(wfMeta{})
239+
if wfVal == nil {
240240
return invoker(ctx, method, req, reply, cc, opts...)
241241
}
242-
242+
wf, _ := wfVal.(*Workflow)
243243
origin := func() error {
244244
ctx1 := dtmgimp.TransInfo2Ctx(ctx, wf.Gid, wf.TransType, wf.currentBranch, wf.currentOp, wf.Dtm)
245245
err := invoker(ctx1, method, req, reply, cc, opts...)

0 commit comments

Comments
 (0)