handle overflow
This commit is contained in:
parent
941d66b34c
commit
0a28ea52b6
|
@ -110,6 +110,13 @@ export const placeBet = functions.runWith({ minInstances: 1 }).https.onCall(
|
||||||
newBetDoc.id
|
newBetDoc.id
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (newP !== undefined && !isFinite(newP)) {
|
||||||
|
return {
|
||||||
|
status: 'error',
|
||||||
|
message: 'Trade rejected due to overflow error.',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
transaction.create(newBetDoc, newBet)
|
transaction.create(newBetDoc, newBet)
|
||||||
|
|
||||||
transaction.update(
|
transaction.update(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user