Jump to content

recipe.lua's MergeRecipes() doesn't guard SaveIndex check sufficiently


rezecib
  • Fixed

If something causes MergeRecipes to get called before SaveIndex gets instantiated (e.g. a modmain calls GetRecipe()), then the game crashes due to SaveIndex not being initialized. On line 72, in the MergeRecipes() function, it checks this:

    if not SaveGameIndex then

which I believe is intended to protect against this very case. However, it needs to be checking with rawget instead to avoid crashing.

 


Steps to Reproduce
Add GLOBAL.GetRecipe('treasurechest') to a modmain.



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.

×
  • Create New...