Skip to content

Commit

Permalink
fix: added error handling for nils in fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
exu committed Feb 3, 2022
1 parent 3186213 commit d5287bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/executor/content/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ type Fetcher struct {
}

func (f Fetcher) Fetch(content *testkube.ScriptContent) (path string, err error) {
if content == nil {
return "", fmt.Errorf("fetch - empty content, make sure script content has valid data structure and is not nil")
}
switch testkube.ScriptContentType(content.Type_) {
case testkube.ScriptContentTypeFileURI:
return f.FetchURI(content.Uri)
Expand Down

0 comments on commit d5287bc

Please sign in to comment.