Codechange: Some more null checks

This commit is contained in:
Charles Pigott
2018-10-27 18:13:42 +01:00
committed by frosch
parent 1778b2d66e
commit bb7353c02a
2 changed files with 7 additions and 3 deletions

View File

@@ -874,7 +874,7 @@ static void RemoveFromConsist(Train *part, bool chain = false)
static void InsertInConsist(Train *dst, Train *chain)
{
/* We do not want to add something in the middle of an articulated part. */
assert(dst->Next() == NULL || !dst->Next()->IsArticulatedPart());
assert(dst != NULL && (dst->Next() == NULL || !dst->Next()->IsArticulatedPart()));
chain->Last()->SetNext(dst->Next());
dst->SetNext(chain);