From aa2b08b9853261e5e674348ffe122736dbd02b0b Mon Sep 17 00:00:00 2001 From: orwell96 Date: Sat, 16 Feb 2019 13:00:59 +0100 Subject: Fix TCBS crash also for route_ui --- advtrains_interlocking/route_ui.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'advtrains_interlocking') diff --git a/advtrains_interlocking/route_ui.lua b/advtrains_interlocking/route_ui.lua index 9b1a0da..45aaa82 100644 --- a/advtrains_interlocking/route_ui.lua +++ b/advtrains_interlocking/route_ui.lua @@ -94,9 +94,14 @@ function atil.show_route_edit_form(pname, sigd, routeid) local c_tcbs, c_ts_id, c_ts, c_rseg, c_lckp while c_sigd and i<=#route do c_tcbs = ildb.get_tcbs(c_sigd) + if not c_tcbs then + itab("-!- No TCBS at "..sigd_to_string(c_sigd)..". Please reconfigure route!") + break + end c_ts_id = c_tcbs.ts_id if not c_ts_id then itab("-!- No track section adjacent to "..sigd_to_string(c_sigd)..". Please reconfigure route!") + break end c_ts = ildb.get_ts(c_ts_id) @@ -112,6 +117,7 @@ function atil.show_route_edit_form(pname, sigd, routeid) itab(" Lock: "..pts.." -> "..state) if not advtrains.is_passive(pos) then itab("-!- No passive component at "..pts..". Please reconfigure route!") + break end end end -- cgit v1.2.3