Skip to content

Commit

Permalink
check if event of event.train is nil https://mods.factorio.com/mod/gr…
Browse files Browse the repository at this point in the history
  • Loading branch information
remijouannet committed Nov 14, 2020
1 parent f5415b7 commit 9174778
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions train.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ local function track_arrival(event)
end

function register_events_train()
if (event == nil or event.train == nil) then
return
end

if event.train.state == defines.train_state.arrive_station then
track_arrival(event)
end
Expand Down

0 comments on commit 9174778

Please sign in to comment.