Skip to content

Commit ca7618c

Browse files
committed
check for if a ship has a parse object first
1 parent 32852c9 commit ca7618c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

code/ship/ship.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10677,7 +10677,7 @@ void change_ship_type(int n, int ship_type, int by_sexp)
1067710677
ph_inf = objp->phys_info;
1067810678

1067910679
// if this ship is the wing leader, update the ship info index that the wing keeps track of.
10680-
if (!Fred_running && p_objp->wingnum > -1 && p_objp->pos_in_wing == 0) {
10680+
if (!Fred_running && p_objp != nullptr && p_objp->wingnum > -1 && p_objp->pos_in_wing == 0) {
1068110681
Wings[p_objp->wingnum].special_ship_ship_info_index = ship_type;
1068210682
}
1068310683

0 commit comments

Comments
 (0)