Page 1 of 1

[2.0.35] Crash after mod error on updating BP in library (SingleBlueprintRecord check fails)

Posted: Sun Feb 23, 2025 12:15 am
by kryojenik
This is a crash of the factorio binary after an error in a mod crashes the mod / save game.

It specifically happens when attempting to update a blueprint in a players library, and not when attempting to update a blueprint in the game library. While attempting to update the BP in the game library, the mod errors shows. After clicking confirm you are returned to the game load screen.

In the attached save, updating the blueprint in inventory works fine. Updating the blueprint in the game library will crash the running save with a mod error (index local 'bp' (a nil value) and return you to the game load screen. Copy either (or make a new) blueprint in the players personal library and attempt to update that one - you will get the index a nil value error, but will crash the binary to desktop after clicking confirm.

pic

Code: Select all

function on_player_setup_blueprint(e)
  local bp = e.stack
  --[[
  Yes, this is a mod error.  It should be something like:

  local bp = e.stack or e.record
  if not bp then
    return
  end
  
  The mod error should probably not result in the full crash of Factorio, just the the mod
  and running save.
  ]]

  local entities = bp.get_blueprint_entities()
  for _, ent in pairs(entities) do
    game.print(ent.name)
  end
end

Re: [2.0.35] Crash after mod error on updating BP in library (SingleBlueprintRecord check fails)

Posted: Tue Apr 08, 2025 6:08 pm
by Rseding91
Thanks for the report. This is now fixed for the next release.