Changeset - r25716:ab9b7d7dd0ba
[Not reviewed]
master
0 1 0
Jonathan G Rennison - 3 years ago 2021-06-19 21:31:23
j.g.rennison@gmail.com
Fix #8169: nullptr dereference when autoreplacing vehicle with no orders (#9387)
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/autoreplace_cmd.cpp
Show inline comments
 
@@ -207,6 +207,7 @@ static int GetIncompatibleRefitOrderIdFo
 
	const Vehicle *u = (v->type == VEH_TRAIN) ? v->First() : v;
 

	
 
	const OrderList *orders = u->orders.list;
 
	if (orders == nullptr) return -1;
 
	for (VehicleOrderID i = 0; i < orders->GetNumOrders(); i++) {
 
		o = orders->GetOrderAt(i);
 
		if (!o->IsRefit()) continue;
0 comments (0 inline, 0 general)