Merge pull request #78 from lbryio/password

pass error back to sync callback
This commit is contained in:
Sean Yesmunt 2020-01-03 15:33:50 -05:00 committed by GitHub
commit 37b09fcce1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

4
dist/bundle.es.js vendored
View file

@ -2502,13 +2502,13 @@ function doSetSync(oldHash, newHash, data) {
function doGetSync(passedPassword, callback) {
const password = passedPassword === null || passedPassword === undefined ? '' : passedPassword;
function handleCallback() {
function handleCallback(error) {
if (callback) {
if (typeof callback !== 'function') {
throw new Error('Second argument passed to "doGetSync" must be a function');
}
callback();
callback(error);
}
}

View file

@ -80,13 +80,13 @@ export function doSetSync(oldHash, newHash, data) {
export function doGetSync(passedPassword, callback) {
const password = passedPassword === null || passedPassword === undefined ? '' : passedPassword;
function handleCallback() {
function handleCallback(error) {
if (callback) {
if (typeof callback !== 'function') {
throw new Error('Second argument passed to "doGetSync" must be a function');
}
callback();
callback(error);
}
}