Skip to content

Commit 5d9debb

Browse files
authored
Merge pull request #789 from Roeterdink/CrashOnTrainWOStartTime
Avoid error on inserting train without start time
2 parents 541056e + 81b11f7 commit 5d9debb

File tree

1 file changed

+6
-0
lines changed
  • Source/Orts.Simulation/Simulation/AIs

1 file changed

+6
-0
lines changed

Source/Orts.Simulation/Simulation/AIs/AI.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,12 @@ public class StartTrains : LinkedList<AITrain>
13671367

13681368
public void InsertTrain(AITrain thisTrain)
13691369
{
1370+
if (thisTrain.StartTime == null)
1371+
{
1372+
Trace.TraceInformation("Train : " + thisTrain.Name + " : missing start time, train not included");
1373+
return;
1374+
}
1375+
13701376
if (this.Count == 0)
13711377
{
13721378
this.AddFirst(thisTrain);

0 commit comments

Comments
 (0)