diff --git a/changelog.txt b/changelog.txt index 67521a2..aa91f8f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 0.3.12 +Date: 25.1.2018 + Bugfixes: + - fixed null reference for recipe.ingredients #2 +--------------------------------------------------------------------------------------------------- Version: 0.3.11 Date: 25.1.2018 Bugfixes: diff --git a/info.json b/info.json index 3334a57..d490b3c 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "ReStack", - "version": "0.3.11", + "version": "0.3.12", "title": "ReStack", "author": "Optera", "contact": "https://forums.factorio.com/memberlist.php?mode=viewprofile&u=21729", diff --git a/modules/lib.lua b/modules/lib.lua index e724828..30d87fb 100644 --- a/modules/lib.lua +++ b/modules/lib.lua @@ -30,8 +30,10 @@ end function SelectItemsByRecipeInput(recipe, stack_size, category) if recipe.ingredients then - for _, ingredient in pairs(recipe.ingredients) do - ReStack_Items[ingredient[1]] = {stack_size = stack_size, type = category} + for n, ingredient in pairs(recipe.ingredients) do + if ingredient[1] then + ReStack_Items[ingredient[1]] = {stack_size = stack_size, type = category} + end end end end