mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
avoid nil
This commit is contained in:
parent
a65088d739
commit
7a49d3541a
|
@ -139,7 +139,7 @@ func (lm *LockManager) InsertLock(path string, expiredAtNs int64, token string,
|
||||||
|
|
||||||
func (lm *LockManager) GetLockOwner(key string) (owner string, err error) {
|
func (lm *LockManager) GetLockOwner(key string) (owner string, err error) {
|
||||||
lm.locks.Range(func(k string, lock *Lock) bool {
|
lm.locks.Range(func(k string, lock *Lock) bool {
|
||||||
if k == key {
|
if k == key && lock != nil {
|
||||||
owner = lock.Owner
|
owner = lock.Owner
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue