diff --git a/src/economy.cpp b/src/economy.cpp index d78d2cccec..6281c08cdd 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1637,7 +1637,7 @@ static void LoadUnloadVehicle(Vehicle *front) CargoPayment *payment = front->cargo_payment; uint artic_part = 0; // Articulated part we are currently trying to load. (not counting parts without capacity) - for (Vehicle *v = front; v != NULL; v = v->Next()) { + for (Vehicle *v = front; v != NULL && payment != NULL; v = v->Next()) { if (v == front || !v->Previous()->HasArticulatedPart()) artic_part = 0; if (v->cargo_cap == 0) continue; artic_part++;