fix: incorrect effective caller when in strict mode (#324)

This commit is contained in:
Asia
2023-01-16 13:25:03 +01:00
committed by GitHub
parent cfee1e136d
commit af46df0688
3 changed files with 8 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ export async function handle(state, action) {
throw new ContractError('Invalid token transfer');
}
if (balances[caller] < qty) {
if (!balances[caller] || balances[caller] < qty) {
throw new ContractError(`Caller balance not high enough to send ${qty} token(s)!`);
}