diff --git a/lib/modules/database/reference.js b/lib/modules/database/reference.js index ffb1af9f..83f535ac 100644 --- a/lib/modules/database/reference.js +++ b/lib/modules/database/reference.js @@ -195,8 +195,11 @@ export default class Reference extends ReferenceBase { return new Promise((resolve, reject) => { const onCompleteWrapper = (error, committed, snapshotData) => { if (isFunction(onComplete)) { - if (error) return onComplete(error, committed, null); - return onComplete(null, committed, new Snapshot(this, snapshotData)); + if (error) { + onComplete(error, committed, null); + } else { + onComplete(null, committed, new Snapshot(this, snapshotData)); + } } if (error) return reject(error);