fix nil pointer

This commit is contained in:
leviok 2020-09-29 09:37:47 +08:00 committed by zhangkun
parent 375b7a1c4c
commit 9b199f0476

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{}, nil
}
return *pci, err