mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-07 14:46:44 +00:00
[NOD-915] Check if lockableFile underlying file is nil before closing it (#709)
This commit is contained in:
parent
3c89e1f7b3
commit
2ef5c2cbac
@ -36,5 +36,9 @@ func (lf *lockableFile) Close() error {
|
|||||||
lf.Lock()
|
lf.Lock()
|
||||||
defer lf.Unlock()
|
defer lf.Unlock()
|
||||||
|
|
||||||
|
if lf.file == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
return errors.WithStack(lf.file.Close())
|
return errors.WithStack(lf.file.Close())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user