It looks like the player
variable is never defined, hence why it is nil
in the control.lua file at:
local function getRecipe(entity)
local recipe
if entity.type:find("lab") then
recipe = player.force.current_research
It looks like on line 388 where this function is called via local recipe = getRecipe(entity)
, the line immediately above it on line 387 contains local player = game.players[playerIndex]
, and it looks like this player should actually be passed in to the getRecipe
function as another argument.