File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -174,13 +174,17 @@ export default class Database extends Base {
174174
175175 _handleDatabaseTransaction ( event ) {
176176 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 ;
177+ let newValue ;
178+ try {
179+ const updateCallback = this . transactions [ id ] ;
180+ newValue = updateCallback ( originalValue ) ;
181+ } finally {
182+ let abort = false ;
183+ if ( newValue === undefined ) {
184+ abort = true ;
185+ }
186+ FirestackDatabase . tryCommitTransaction ( id , { value : newValue } , abort ) ;
182187 }
183- FirestackDatabase . tryCommitTransaction ( id , { value : newValue } , abort ) ;
184188 }
185189
186190 /**
You can’t perform that action at this time.
0 commit comments