Skip to content

Commit fac259e

Browse files
Merge pull request #27566 from grey3228/fix/check_newGenericDecompressor_err
check err returned by newGenericDecompressor
2 parents f1b80bf + fdc738b commit fac259e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pkg/machine/compression/uncompressed.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ type uncompressedDecompressor struct {
1010

1111
func newUncompressedDecompressor(compressedFilePath string) (*uncompressedDecompressor, error) {
1212
d, err := newGenericDecompressor(compressedFilePath)
13+
if err != nil {
14+
return nil, err
15+
}
1316
return &uncompressedDecompressor{*d}, err
1417
}
1518

pkg/machine/compression/zip.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ type zipDecompressor struct {
1616

1717
func newZipDecompressor(compressedFilePath string) (*zipDecompressor, error) {
1818
d, err := newGenericDecompressor(compressedFilePath)
19+
if err != nil {
20+
return nil, err
21+
}
1922
return &zipDecompressor{*d, nil, nil}, err
2023
}
2124

0 commit comments

Comments
 (0)