[Pkg-javascript-commits] [node-leveldown] 97/492: close() callback existential check
Andrew Kelley
andrewrk-guest at moszumanska.debian.org
Sun Jul 6 17:13:48 UTC 2014
This is an automated email from the git hooks/post-receive script.
andrewrk-guest pushed a commit to annotated tag rocksdb-0.10.1
in repository node-leveldown.
commit f4c69178f7b636fdab2619271b0ec4187720c2b2
Author: Rod Vagg <rod at vagg.org>
Date: Fri Dec 14 18:17:57 2012 +1100
close() callback existential check
---
lib/levelup.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/levelup.js b/lib/levelup.js
index 431cbaa..b44e797 100644
--- a/lib/levelup.js
+++ b/lib/levelup.js
@@ -85,11 +85,11 @@ LevelUP.prototype = {
this._db.close(function () {
this._status = 'closed'
this.emit('closed')
- callback.apply(null, arguments)
+ callback && callback.apply(null, arguments)
}.bind(this))
this._db = null
} else if (this._status == 'closed') {
- callback()
+ callback && callback()
} else if (this._status == 'closing') {
this.on('closed', callback)
} else if (this._status == 'opening') {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-leveldown.git
More information about the Pkg-javascript-commits
mailing list