[#951] adm: Check for error when reading contracts from archive
All checks were successful
Vulncheck / Vulncheck (pull_request) Successful in 3m17s
DCO action / DCO (pull_request) Successful in 3m3s
Build / Build Components (1.21) (pull_request) Successful in 4m28s
Build / Build Components (1.22) (pull_request) Successful in 4m29s
Pre-commit hooks / Pre-commit (pull_request) Successful in 4m46s
Tests and linters / gopls check (pull_request) Successful in 6m41s
Tests and linters / Lint (pull_request) Successful in 7m54s
Tests and linters / Staticcheck (pull_request) Successful in 7m32s
Tests and linters / Tests (1.21) (pull_request) Successful in 9m26s
Tests and linters / Tests with -race (pull_request) Successful in 9m26s
Tests and linters / Tests (1.22) (pull_request) Successful in 9m30s
All checks were successful
Vulncheck / Vulncheck (pull_request) Successful in 3m17s
DCO action / DCO (pull_request) Successful in 3m3s
Build / Build Components (1.21) (pull_request) Successful in 4m28s
Build / Build Components (1.22) (pull_request) Successful in 4m29s
Pre-commit hooks / Pre-commit (pull_request) Successful in 4m46s
Tests and linters / gopls check (pull_request) Successful in 6m41s
Tests and linters / Lint (pull_request) Successful in 7m54s
Tests and linters / Staticcheck (pull_request) Successful in 7m32s
Tests and linters / Tests (1.21) (pull_request) Successful in 9m26s
Tests and linters / Tests with -race (pull_request) Successful in 9m26s
Tests and linters / Tests (1.22) (pull_request) Successful in 9m30s
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
8fcd0f8f8d
commit
efcebdf009
1 changed files with 7 additions and 4 deletions
|
@ -122,11 +122,11 @@ func readContractsFromArchive(file io.Reader, names []string) (map[string]*Contr
|
|||
}
|
||||
|
||||
r := tar.NewReader(gr)
|
||||
for h, err := r.Next(); ; h, err = r.Next() {
|
||||
if err != nil {
|
||||
break
|
||||
var h *tar.Header
|
||||
for h, err = r.Next(); err == nil && h != nil; h, err = r.Next() {
|
||||
if h.Typeflag != tar.TypeReg {
|
||||
continue
|
||||
}
|
||||
|
||||
dir, _ := filepath.Split(h.Name)
|
||||
ctrName := filepath.Base(dir)
|
||||
|
||||
|
@ -149,6 +149,9 @@ func readContractsFromArchive(file io.Reader, names []string) (map[string]*Contr
|
|||
}
|
||||
m[ctrName] = cs
|
||||
}
|
||||
if err != nil && err != io.EOF {
|
||||
return nil, fmt.Errorf("can't read contracts from archive: %w", err)
|
||||
}
|
||||
|
||||
for ctrName, cs := range m {
|
||||
if cs.RawNEF == nil {
|
||||
|
|
Loading…
Reference in a new issue