Skip to content

Commit

Permalink
bit of extra error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
notnotmelon committed Nov 12, 2023
1 parent ccb0e97 commit db38a5f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions prototypes/functions/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,9 @@ function overrides.results_replacer(recipe, old, new, new_amount)
end
if recipe.results then
for r, result in pairs(recipe.results) do
if type(result) ~= 'table' then
error('ERROR: Recipe ' .. recipe.name .. ' has a results table that is not a table')
end
if result.name == old then
data.raw.recipe[recipe.name].results[r].name = new
if new_amount ~= nil then
Expand Down

0 comments on commit db38a5f

Please sign in to comment.