Skip to content

Commit

Permalink
Fix panic in frontend on empty PollForDecisionTask response (cadence-…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamer Eldeeb authored Apr 19, 2017
1 parent d098154 commit 70abdc1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions service/frontend/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,13 @@ func (wh *WorkflowHandler) PollForDecisionTask(
return nil, wrapError(err)
}

history, err := wh.getHistory(info.ID, *matchingResp.GetWorkflowExecution(), matchingResp.GetStartedEventId()+1)
if err != nil {
return nil, wrapError(err)
var history *gen.History
if matchingResp.IsSetWorkflowExecution() {
// Non-empty response. Get the history
history, err = wh.getHistory(info.ID, *matchingResp.GetWorkflowExecution(), matchingResp.GetStartedEventId()+1)
if err != nil {
return nil, wrapError(err)
}
}
return createPollForDecisionTaskResponse(matchingResp, history), nil
}
Expand Down

0 comments on commit 70abdc1

Please sign in to comment.