mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 04:13:11 +00:00
Spreadsheet: Prevent infinite loop in Range ctor
This commit is contained in:
parent
12ef20b869
commit
9fcd3f7920
|
@ -187,6 +187,10 @@ class Range {
|
|||
// 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");
|
||||
if (typeof startingRow === "string" || typeof endingRow === "string")
|
||||
throw new Error(
|
||||
"startingRow or endingRow is a string, this will cause an infinite loop"
|
||||
);
|
||||
this.startingColumnName = startingColumnName;
|
||||
this.endingColumnName = endingColumnName;
|
||||
this.startingRow = startingRow;
|
||||
|
|
Loading…
Reference in a new issue