We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1dc4911 commit 12a3f1cCopy full SHA for 12a3f1c
lib/modules/database/index.js
@@ -174,13 +174,17 @@ export default class Database extends Base {
174
175
_handleDatabaseTransaction(event) {
176
const {id, originalValue} = event;
177
- const updateCallback = this.transactions[id];
178
- const newValue = updateCallback(originalValue);
179
- let abort = false;
180
- if (newValue === undefined) {
181
- abort = true;
+ let newValue;
+ try {
+ const updateCallback = this.transactions[id];
+ newValue = updateCallback(originalValue);
+ } finally {
182
+ let abort = false;
183
+ if (newValue === undefined) {
184
+ abort = true;
185
+ }
186
+ FirestackDatabase.tryCommitTransaction(id, {value: newValue}, abort);
187
}
- FirestackDatabase.tryCommitTransaction(id, {value: newValue}, abort);
188
189
190
/**
0 commit comments