internal: if err happend just return it

This commit is contained in:
Weixie Cui 2026-05-10 08:12:55 +08:00
parent 1abbae239d
commit b94d711546

View file

@ -627,7 +627,9 @@ func (b *simBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types
if b.base.Hash() == hash {
return b.base, nil
}
if header, err := b.b.HeaderByHash(ctx, hash); err == nil {
if header, err := b.b.HeaderByHash(ctx, hash); err != nil {
return nil, err
} else if header != nil {
return header, nil
}
// Check simulated headers