mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +00:00
add nil check in defer
This commit is contained in:
parent
4f75049ea0
commit
a86d0510d1
1 changed files with 3 additions and 1 deletions
|
|
@ -442,7 +442,9 @@ func (f *TxFetcher) loop() {
|
|||
if f.chain != nil {
|
||||
headEventCh = make(chan core.ChainEvent, 10)
|
||||
sub := f.chain.SubscribeChainEvent(headEventCh)
|
||||
defer sub.Unsubscribe()
|
||||
if sub != nil {
|
||||
defer sub.Unsubscribe()
|
||||
}
|
||||
}
|
||||
|
||||
for {
|
||||
|
|
|
|||
Loading…
Reference in a new issue