Skip to content

Commit

Permalink
Fix NPE for failover query
Browse files Browse the repository at this point in the history
  • Loading branch information
vancexu authored Oct 13, 2020
1 parent 25df2bb commit eee7337
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/cli/adminFailoverCommands.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,17 @@ func AdminFailoverQuery(c *cli.Context) {
if err != nil {
ErrorAndExit("Failed to describe workflow", err)
}
if descResp.WorkflowExecutionInfo.CloseStatus.Equals(shared.WorkflowExecutionCloseStatusTerminated) {
if isWorkflowTerminated(descResp) {
result.State = failovermanager.WorkflowAborted
}
prettyPrintJSONObject(result)
}

func isWorkflowTerminated(descResp *shared.DescribeWorkflowExecutionResponse) bool {
return descResp.WorkflowExecutionInfo.CloseStatus != nil &&
descResp.WorkflowExecutionInfo.CloseStatus.Equals(shared.WorkflowExecutionCloseStatusTerminated)
}

// AdminFailoverAbort abort a failover workflow
func AdminFailoverAbort(c *cli.Context) {
client := getCadenceClient(c)
Expand Down

0 comments on commit eee7337

Please sign in to comment.