DanielKote / Foreman2

Visual planning tool for Factorio
Other
158 stars 14 forks source link

Fix issue where export can fail on mineable resources with no products. #46

Closed mGuv closed 1 year ago

mGuv commented 1 year ago

Problem

I was playing the latest version of Seablock and trying to use Foreman to export the recipe/item list would fail with the "possible mod conflict" error.

Upon further inspection, the actual error was coming from the .lua code, saying that you can't pass nil in to pairs when exporting the products of a mineable resource. I assume this is something weird to do with Seablock and/or an overwritten recipe where it has set the products to empty. I wasn't sure how to debug the .lua further to figure out what item/recipe was causing it.

Solution

I've wrapped the code that parses the products from mining in a nil check so it only tries that code when the property is set.

Note: I have no idea if this is the correct fix but it worked for me and everything seems okay in Foreman afterwards.

mrozpara commented 1 year ago

see: [https://github.com/DanielKote/Foreman2/issues/40](issue #40)

mGuv commented 1 year ago

Okay, I have no idea what's going on with those files. They look indented fine on my machine but indented weirdly in the commit - even after I tried to fix them.

DanielKote commented 1 year ago

Issue has been fixed