diff options
author | frankiebee <frankie.diamond@gmail.com> | 2017-08-04 09:20:01 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2017-08-04 09:22:08 +0800 |
commit | 7de58c8709dd78e7088210e2c6bc5df79e008538 (patch) | |
tree | ef173ff4d00c634962f616cd4f502f2e3986a731 /app/scripts | |
parent | 8a9d0073b1d6b959e9374180e2f52d12ea8319ca (diff) | |
download | tangerine-wallet-browser-7de58c8709dd78e7088210e2c6bc5df79e008538.tar tangerine-wallet-browser-7de58c8709dd78e7088210e2c6bc5df79e008538.tar.gz tangerine-wallet-browser-7de58c8709dd78e7088210e2c6bc5df79e008538.tar.bz2 tangerine-wallet-browser-7de58c8709dd78e7088210e2c6bc5df79e008538.tar.lz tangerine-wallet-browser-7de58c8709dd78e7088210e2c6bc5df79e008538.tar.xz tangerine-wallet-browser-7de58c8709dd78e7088210e2c6bc5df79e008538.tar.zst tangerine-wallet-browser-7de58c8709dd78e7088210e2c6bc5df79e008538.zip |
fix cancelTransaction not reciving a callback
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/lib/nodeify.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/scripts/lib/nodeify.js b/app/scripts/lib/nodeify.js index 299bfe624..832d6c6d3 100644 --- a/app/scripts/lib/nodeify.js +++ b/app/scripts/lib/nodeify.js @@ -1,9 +1,10 @@ const promiseToCallback = require('promise-to-callback') -module.exports = function(fn, context) { +module.exports = function nodeify (fn, context) { return function(){ const args = [].slice.call(arguments) const callback = args.pop() + if (typeof callback !== 'function') throw new Error('callback is not a function') promiseToCallback(fn.apply(context, args))(callback) } } |