Skip to content

Commit

Permalink
fix npe (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyuhang0 authored Dec 7, 2023
1 parent 83ce73a commit 3cd0466
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/provider/restore_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,12 @@ func refreshRestoreResourceData(resp *restoreApi.GetRestoreTaskOKBody, data *res
data.RestoreId = types.StringValue(resp.ID)
data.CreateTimestamp = types.StringValue(resp.CreateTimestamp.String())
data.Status = types.StringValue(resp.Status)
data.Cluster = &cluster{
Id: resp.Cluster.ID,
Name: resp.Cluster.Name,
Status: resp.Cluster.Status,
if resp.Cluster != nil {
data.Cluster = &cluster{
Id: resp.Cluster.ID,
Name: resp.Cluster.Name,
Status: resp.Cluster.Status,
}
}
data.ErrorMessage = types.StringValue(resp.ErrorMessage)
}
Expand Down

0 comments on commit 3cd0466

Please sign in to comment.