Skip to content

Commit

Permalink
Fix NPE in DescribeMutableState (#3850)
Browse files Browse the repository at this point in the history
  • Loading branch information
yycptt committed Dec 14, 2020
1 parent 6e20336 commit 92c7457
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions service/history/historyEngine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1393,10 +1393,12 @@ func (e *historyEngineImpl) DescribeMutableState(

response = &h.DescribeMutableStateResponse{}

if msb := cacheCtx.GetWorkflowExecution(); cacheHit && msb != nil {
response.MutableStateInCache, err = e.toMutableStateJSON(msb)
if err != nil {
return nil, err
if cacheHit {
if msb := cacheCtx.GetWorkflowExecution(); msb != nil {
response.MutableStateInCache, err = e.toMutableStateJSON(msb)
if err != nil {
return nil, err
}
}
}

Expand Down

0 comments on commit 92c7457

Please sign in to comment.