Skip to content

Commit

Permalink
fix: nullsafe access
Browse files Browse the repository at this point in the history
  • Loading branch information
SantriptaSharma committed Nov 21, 2023
1 parent 55b37ea commit a732456
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/parse-dining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function isMenuSheet(menu: xl.Worksheet): boolean {
const [day, date] = [menu.getCell(1 + rowOffset, 1), menu.getCell(2 + rowOffset, 1)]
const [bfast, lunch, snacks, dinner] = [menu.getCell(3 + rowOffset, 1), menu.getCell(19 + rowOffset, 1), menu.getCell(32 + rowOffset, 1), menu.getCell(37 + rowOffset, 1)]

if (day.value.toString().trim() != "DAY" || date.value.toString().trim() != "DATE") {
if (day.value?.toString().trim() != "DAY" || date.value?.toString().trim() != "DATE") {
if (rowOffset > 3) return false;

console.log("increased row offset");
Expand Down

0 comments on commit a732456

Please sign in to comment.