mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-11 21:11:10 -04:00
Protect against NaN task cost
This commit is contained in:
parent
c8dc8fb5b9
commit
28621c9860
1 changed files with 1 additions and 1 deletions
|
@ -117,7 +117,7 @@ class TokenBucket {
|
|||
if (cost <= this._tokenCount) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (cost > this._limit) {
|
||||
if (!(cost <= this._limit)) {
|
||||
return Promise.reject(new Error('Task cost is greater than bucket limit'));
|
||||
}
|
||||
return new Promise(resolve => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue