Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Add nil check in databricks plugin (#332)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <pingsutw@apache.org>
  • Loading branch information
pingsutw authored May 8, 2023
1 parent 1e0faab commit 76a80ec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions go/tasks/plugins/webapi/databricks/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ func (p Plugin) Get(ctx context.Context, taskCtx webapi.GetContext) (latest weba
if err != nil {
return nil, err
}
if data == nil || data["state"] == nil {
return nil, errors.Errorf("CorruptedPluginState", "can't get the job state")
}
jobState := data["state"].(map[string]interface{})
message := fmt.Sprintf("%s", jobState["state_message"])
jobID := fmt.Sprintf("%.0f", data["job_id"])
Expand Down

0 comments on commit 76a80ec

Please sign in to comment.