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

Commit 76a80ec

Browse files
authored
Add nil check in databricks plugin (#332)
Signed-off-by: Kevin Su <pingsutw@apache.org>
1 parent 1e0faab commit 76a80ec

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

go/tasks/plugins/webapi/databricks/plugin.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ func (p Plugin) Get(ctx context.Context, taskCtx webapi.GetContext) (latest weba
168168
if err != nil {
169169
return nil, err
170170
}
171+
if data == nil || data["state"] == nil {
172+
return nil, errors.Errorf("CorruptedPluginState", "can't get the job state")
173+
}
171174
jobState := data["state"].(map[string]interface{})
172175
message := fmt.Sprintf("%s", jobState["state_message"])
173176
jobID := fmt.Sprintf("%.0f", data["job_id"])

0 commit comments

Comments
 (0)