mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-05 13:46:42 +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()
|
||||
defer lf.Unlock()
|
||||
|
||||
if lf.file == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return errors.WithStack(lf.file.Close())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user