fix: accessing nonexistant variable

This commit is contained in:
Max Richter
2025-11-02 21:14:41 +01:00
parent 098da12ac4
commit 928782c453
4 changed files with 8 additions and 7 deletions

View File

@@ -36,7 +36,7 @@ function ValidRecipe({
portion,
}: { recipe: RecipeResource; amount: Signal<number>; portion: number }) {
const ingredients = parseIngredients(
recipe.content.recipeIngredient?.join("\n"),
recipe.content.recipeIngredient?.join("\n") || "",
);
return (
@@ -54,7 +54,8 @@ function ValidRecipe({
<div class="pl-2">
<ol class="list-decimal grid gap-4">
{recipe.content.recipeInstructions &&
(recipe.content.recipeInstructions.filter((inst) => !!inst?.length)
(recipe.content.recipeInstructions
.filter((inst) => !!inst?.length)
.map((instruction) => {
return (
<li