Fix a bug when a recipe does not have any instructions

This commit is contained in:
Lucas Verney 2018-03-11 21:57:13 +01:00
parent 40fbc5b662
commit 6fad7bec13
1 changed files with 2 additions and 2 deletions

View File

@ -16,9 +16,9 @@ function _postProcessRecipes(response) {
parsed.recipes = parsed.recipes.map(item => Object.assign( parsed.recipes = parsed.recipes.map(item => Object.assign(
item, item,
{ {
instructions: item.instructions.split(/[\r\n]\n/).map( instructions: item.instructions ? item.instructions.split(/[\r\n]\n/).map(
line => line.trim(), line => line.trim(),
), ) : [],
}, },
)); ));
} }