Skip to content

Commit

Permalink
add default values so it wont crash on out of memory calculation by c…
Browse files Browse the repository at this point in the history
…alcualting power of infinity (#9060)
  • Loading branch information
LeeLenaleee committed May 10, 2021
1 parent 1df4883 commit 9885126
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/scripts/log2.js
Expand Up @@ -21,8 +21,8 @@ export default class Log2Axis extends Scale {
buildTicks() {
const ticks = [];

let power = Math.floor(Math.log2(this.min));
let maxPower = Math.ceil(Math.log2(this.max));
let power = Math.floor(Math.log2(this.min || 1));
let maxPower = Math.ceil(Math.log2(this.max || 2));
while (power <= maxPower) {
ticks.push({value: Math.pow(2, power)});
power += 1;
Expand Down

0 comments on commit 9885126

Please sign in to comment.