Fix panic in frontend on empty PollForDecisionTask response
Issue
@@ -263,10 +263,14 @@ func (wh *WorkflowHandler) PollForDecisionTask(
return nil, wrapError(err)
}
- history, err := wh.getHistory(info.ID, *matchingResp.GetWorkflowExecution(), matchingResp.GetStartedEventId()+1)
+ 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
}
