Skip to content

Commit 91a07d3

Browse files
authored
Update split.move
1 parent dc55d17 commit 91a07d3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

paysplit/sources/split.move

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ module PaySplit::split {
118118
public fun view_balance(admin_addr: address, owner: address): u64 acquires Splitter {
119119
let s = borrow_global<Splitter>(admin_addr);
120120
let (found, idx) = find_balance_index(&s.balances, owner);
121-
if (!found) 0 else (*vector::borrow(&s.balances, idx)).amount
121+
if (!found) {
122+
0
123+
} else {
124+
let b = vector::borrow(&s.balances, idx);
125+
b.amount
126+
}
122127
}
123128
}

0 commit comments

Comments
 (0)