diff options
author | orwell96 <orwell@bleipb.de> | 2019-02-16 13:00:59 +0100 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2019-02-16 13:00:59 +0100 |
commit | aa2b08b9853261e5e674348ffe122736dbd02b0b (patch) | |
tree | e21f8abae46ac111ff3cd6bab5a58807273666ec /advtrains_interlocking/route_ui.lua | |
parent | ede60d0a174d7439c42b9001008e08ef487c5416 (diff) | |
download | advtrains-aa2b08b9853261e5e674348ffe122736dbd02b0b.tar.gz advtrains-aa2b08b9853261e5e674348ffe122736dbd02b0b.tar.bz2 advtrains-aa2b08b9853261e5e674348ffe122736dbd02b0b.zip |
Fix TCBS crash also for route_ui
Diffstat (limited to 'advtrains_interlocking/route_ui.lua')
-rw-r--r-- | advtrains_interlocking/route_ui.lua | 6 |
1 files changed, 6 insertions, 0 deletions
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 |