Skip to content

Commit

Permalink
pullzone: fix panic when origin or routing blocks are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
rafael-at-bunny committed Jan 7, 2025
1 parent 8a6fc71 commit c6dec5f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/pullzoneresourcevalidator/middleware_script.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ func (v middlewareScriptValidator) ValidateResource(ctx context.Context, req res
var routing attr.Value
req.Config.GetAttribute(ctx, path.Root("routing"), &routing)

if origin.IsNull() || routing.IsNull() {
return
}

if origin.(types.Object).Attributes()["middleware_script"].IsUnknown() || routing.(types.Object).Attributes()["filters"].IsUnknown() {
return
}
Expand Down

0 comments on commit c6dec5f

Please sign in to comment.