Skip to content

Commit f3d9ad7

Browse files
committed
better finally
1 parent 960b0c7 commit f3d9ad7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/memory/space.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -782,11 +782,12 @@ const commit = <Space extends MemorySpace>(
782782
const the = COMMIT_LOG_TYPE;
783783
const of = transaction.sub;
784784
const stmt = session.store.prepare(EXPORT);
785-
const row = stmt.get({ the, of }) as
786-
| StateRow
787-
| undefined;
788-
stmt.finalize();
789-
785+
let row;
786+
try {
787+
row = stmt.get({ the, of }) as StateRow | undefined;
788+
} finally {
789+
stmt.finalize();
790+
}
790791
const [since, cause] = row
791792
? [
792793
(JSON.parse(row.is as string) as CommitData).since + 1,

0 commit comments

Comments
 (0)