Skip to content

Commit 6894780

Browse files
authored
Merge pull request #5 from asriram3/master
added null check for context in RTryLock
2 parents a6eb2bd + 4e2e27d commit 6894780

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

trylock.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ func (m *trylocker) RTryLock(ctx context.Context) bool {
112112
return true
113113
}
114114
}
115+
if ctx == nil {
116+
return false
117+
}
115118

116119
// get broadcast channel
117120
ch := m.channel()

0 commit comments

Comments
 (0)