Skip to content

Commit eea47c1

Browse files
ilopezlunaCopilot
andauthored
Update pkg/distribution/packaging/dirtar.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 38faf8c commit eea47c1

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

pkg/distribution/packaging/dirtar.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ func CreateDirectoryTarArchive(dirPath string) (string, error) {
4141

4242
// Walk the directory tree
4343
err = filepath.Walk(dirPath, func(path string, info os.FileInfo, err error) error {
44+
if err != nil {
45+
return err
46+
}
47+
if info == nil {
48+
return fmt.Errorf("nil FileInfo for path: %s", path)
49+
}
4450
// Skip symlinks - they're not needed for model distribution and are
4551
// skipped during extraction for security reasons
4652
if info.Mode()&os.ModeSymlink != 0 {
4753
return nil
4854
}
49-
if err != nil {
50-
return err
51-
}
5255

5356
// Create tar header
5457
header, err := tar.FileInfoHeader(info, "")

0 commit comments

Comments
 (0)