Skip to content

Commit 581df4b

Browse files
authored
error handling for file name extraction
Add error handling for empty trimmed path in URL
1 parent da231d9 commit 581df4b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pkg/download/blob.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ func GetSASBlob(blobURI, blobSas, targetDir string) (string, error) {
101101
if fileName == "" {
102102
return "", errors.Errorf("cannot extract file name from URL: %q", loggableBlobUri)
103103
}
104+
105+
if len(splitStrings) == 0 {
106+
return "", fmt.Errorf("cannot extract file name from URL: %q. Trimmed path was empty", loggableBlobUri);
107+
}
104108

105109
// Create the local file
106110
scriptFilePath := filepath.Join(targetDir, fileName)

0 commit comments

Comments
 (0)