From 44965bf3aacb421a2b229e743f650f66c3db8b11 Mon Sep 17 00:00:00 2001 From: Brevven Date: Tue, 15 Sep 2020 17:12:39 -0700 Subject: [PATCH] check recipe exists before adding to --- data-util.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data-util.lua b/data-util.lua index f1ea2b6..aec93b8 100644 --- a/data-util.lua +++ b/data-util.lua @@ -2,7 +2,9 @@ local data_util = {} --- Add a given quantity of titanium plates to a given recipe function data_util.add_titanium_ingredient(quantity, recipe) - table.insert(recipe.ingredients, {"titanium-plate", quantity}) + if recipe ~= nil and recipe.ingredients ~= nil then + table.insert(recipe.ingredients, {"titanium-plate", quantity}) + end end --- Add titanium processing as a prerequisite to a given technology