Skip to content

Commit

Permalink
Spreadsheet: Prevent infinite loop in Range ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
u9g authored and alimpfard committed Feb 20, 2022
1 parent 54b4eb6 commit b3591d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Base/res/js/Spreadsheet/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ class Ranges {

class Range {
constructor(startingColumnName, endingColumnName, startingRow, endingRow, columnStep, rowStep) {
// using == to account for '0' since js will parse `+'0'` to 0
if (columnStep == 0 || rowStep == 0)
throw new Error("rowStep or columnStep is 0, this will cause an infinite loop");
this.startingColumnName = startingColumnName;
this.endingColumnName = endingColumnName;
this.startingRow = startingRow;
Expand Down

0 comments on commit b3591d2

Please sign in to comment.