Skip to content

Commit b6f1f9c

Browse files
committed
fix: panic on double-opening a table
1 parent 92172bd commit b6f1f9c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

crates/modules/meta/src/module.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,10 @@ impl MetaModule {
239239
approved_peer: PeerPubkey,
240240
) -> DbTxResult<Vec<CItemEffect>, Whatever> {
241241
// Look up the value that the approved peer voted for
242-
let votes_tbl = dbtx.open_table(&tables::key_value_votes::TABLE)?;
243-
244-
match votes_tbl.get(&(key, approved_peer))? {
242+
match dbtx
243+
.open_table(&tables::key_value_votes::TABLE)?
244+
.get(&(key, approved_peer))?
245+
{
245246
Some(approved_value) => {
246247
// Cast our vote for the same value as the approved peer
247248
let value = approved_value.value();

0 commit comments

Comments
 (0)