Merge pull request #4082 from leviok/fix-nil-pointer

fix nil pointer in StateSectorPreCommitInfo
This commit is contained in:
Łukasz Magiera 2020-11-23 18:58:32 +01:00 committed by GitHub
commit be2a5942fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -792,6 +792,8 @@ func (a *StateAPI) StateSectorPreCommitInfo(ctx context.Context, maddr address.A
pci, err := stmgr.PreCommitInfo(ctx, a.StateManager, maddr, n, ts)
if err != nil {
return miner.SectorPreCommitOnChainInfo{}, err
} else if pci == nil {
return miner.SectorPreCommitOnChainInfo{}, xerrors.Errorf("precommit info is not exists")
}
return *pci, err