From 292de7d6e949d73ab1d6551a054649230bb34a71 Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Thu, 16 Mar 2023 11:08:34 -0700 Subject: [PATCH] Add nil check in databricks plugin Signed-off-by: Kevin Su --- go/tasks/plugins/webapi/databricks/plugin.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/tasks/plugins/webapi/databricks/plugin.go b/go/tasks/plugins/webapi/databricks/plugin.go index 920a842f9..c1bc05e70 100644 --- a/go/tasks/plugins/webapi/databricks/plugin.go +++ b/go/tasks/plugins/webapi/databricks/plugin.go @@ -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"])