Skip to content
Browse files

dont call cb unless defined in unlock, warn if unlocking twice

  • Loading branch information...
1 parent 6e22848 commit a56802f7c001699f2292afeb90dd9bad99391939 Jaakko Manninen committed
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/cache.js
View
8 lib/cache.js
@@ -1096,8 +1096,12 @@ function LockFile(path) {
LockFile.prototype.unlock = function(cb) {
var self = this
- if (!this.locked)
- return cb()
+ if (!this.locked) {
+ console.trace()
+ console.warn('LockFile.unlock() called twice for '+this.path)
+ if (cb) cb()
+ return
+ }
lockFile.unlock(this.path, function(er) {
self.locked = false

0 comments on commit a56802f

Please sign in to comment.
Something went wrong with that request. Please try again.