|
|
@@ -137,7 +137,11 @@ module.exports = {
|
|
|
//get property locations
|
|
|
let locations = {};
|
|
|
for(let i = 0; i < array[0].length; i++){
|
|
|
- switch(array[0][i].toLowerCase()){
|
|
|
+ let title = "";
|
|
|
+ try{title = array[0][i].toLowerCase()}
|
|
|
+ catch{title = ""}
|
|
|
+
|
|
|
+ switch(title){
|
|
|
case "name": locations.name = i; break;
|
|
|
case "price": locations.price = i; break;
|
|
|
case "ingredients": locations.ingredient = i; break;
|
|
|
@@ -166,7 +170,7 @@ module.exports = {
|
|
|
let recipes = [];
|
|
|
let currentRecipe = {};
|
|
|
for(let i = 1; i < array.length; i++){
|
|
|
- if(array[i].length === 0){
|
|
|
+ if(array[i][locations.ingredient] === undefined){
|
|
|
continue;
|
|
|
}
|
|
|
|