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 committed Oct 13, 2020
1 parent cd103de commit 6960e9b
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 6960e9b

Please sign in to comment.