Skip to content

Commit

Permalink
Fix check for empty sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjzsun authored May 18, 2022
1 parent c035599 commit 9cb01d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sheetScript.gs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ function getNextDebugCol(debugSheet) {
function getNextDebugRow(debugSheet, nextDebugCol) {
var data = debugSheet.getDataRange().getValues();
// Empty sheet, return first row
if (data.length == 1 && data[0].length == 0) return 0;
if (data.length == 1 && data[0].length == 1 && data[0][0] == "") return 0;
// Only one column, not filled yet, return last row + 1
// Second check needed in case reservedDebugNumRows has expanded while other columns are filled
if (data.length < reservedDebugNumRows && data[0][0] != "") return data.length;
Expand Down

0 comments on commit 9cb01d6

Please sign in to comment.