Smarter Trains


Train lines, automated refueling, 'dynamic' train schedules

Content
30 days ago
0.14 - 1.1
6.87K
Trains

b Crash on opening train schedule (attempt to index field 'condition' - a NIL value)

4 years ago

This crash has two forms: One that leads to crash to main menu, and another one that just prints out complaint in-game.

Steps to reproduce:
1. Add a train station through the normal train schedule.
2. Add condition "Item count". Don't enter any value, nor select any item in the GUI.
3. Close the schedule.
4. Click on the locomotive again to re-open schedule. => If the station with the empty "item count" condition is listed in Smarter Trains "line" display, the error happens.

If the error happens so that it is on the first page of line display, you will get crash to main menu. If it is on later page, you only seem to get complaint as game message (No crash to main menu). Most likely the "fatal" crash happens due to it being triggered inside an event handler(?)...

The full content of the crash-dialog:
"The mod Marter Trains (5.0.2) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event SmartTrans::on_gui_opened (ID 84)
SmartTrains/gui.lua:257: attempt to index field 'condition' (a nil value)
stack traceback:
SmartTrains/gui.lua:257: in function 'showTrainInfoWindow'
SmartTrains/gui.lua:33: in function 'create_or_update'
SmartTrains/control.lua: in function
<SmartTrains/control-lua:1080>"

4 years ago

Thanks for the report, should be fixed in the latest update

4 years ago

Thank you for the fix.
I confirm that the crash no longer happens with 5.0.3 version of the mod.

New response