diff --git a/cookie-garden-helper.js b/cookie-garden-helper.js index 09d995b..262730e 100644 --- a/cookie-garden-helper.js +++ b/cookie-garden-helper.js @@ -153,7 +153,7 @@ class Garden { if (plant.weed && config.autoHarvestWeeds) { this.harvest(x, y); } - let [seedId] = config.savedPlot[y][x]; + let [seedId] = config.savedPlot.length > 0 ? config.savedPlot[y][x] : [0, 0]; seedId -= 1; if ( config.autoHarvestCleanGarden && diff --git a/src/Garden.js b/src/Garden.js index 09963a0..d6414ae 100644 --- a/src/Garden.js +++ b/src/Garden.js @@ -103,7 +103,7 @@ class Garden { if (plant.weed && config.autoHarvestWeeds) { this.harvest(x, y); } - let [seedId] = config.savedPlot[y][x]; + let [seedId] = config.savedPlot.length > 0 ? config.savedPlot[y][x] : [0, 0]; seedId -= 1; if ( config.autoHarvestCleanGarden &&