Merge pull request #9703 from filecoin-project/asr/fix-panic

fix: cli: check found before dereferencing SectorInfo
This commit is contained in:
Geoff Stuart 2022-11-22 12:54:52 -05:00 committed by GitHub
commit 70dc920f8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -919,12 +919,12 @@ var sectorsRenewCmd = &cli.Command{
} }
si, found := activeSectorsInfo[abi.SectorNumber(id)] si, found := activeSectorsInfo[abi.SectorNumber(id)]
if len(si.DealIDs) > 0 && cctx.Bool("only-cc") {
continue
}
if !found { if !found {
return xerrors.Errorf("sector %d is not active", id) return xerrors.Errorf("sector %d is not active", id)
} }
if len(si.DealIDs) > 0 && cctx.Bool("only-cc") {
continue
}
sis = append(sis, si) sis = append(sis, si)
} }