Skip to content

Commit

Permalink
fix panic of nil dereference (hashicorp#23695)
Browse files Browse the repository at this point in the history
  • Loading branch information
wuxu92 authored Oct 30, 2023
1 parent f1125b4 commit 726a53d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"time"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2019-06-01-preview/registries"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2019-06-01-preview/runs"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2019-06-01-preview/tasks"
Expand Down Expand Up @@ -104,8 +105,9 @@ func (r ContainerRegistryTaskScheduleResource) Create() sdk.ResourceFunc {

runName := ""
for _, v := range *run.Model {
if *v.Properties.Task == taskId.TaskName {
runName = *v.Name
if v.Properties != nil && pointer.From(v.Properties.Task) == taskId.TaskName {
runName = pointer.From(v.Name)
break
}
}

Expand Down

0 comments on commit 726a53d

Please sign in to comment.