Skip to content

Commit 126e440

Browse files
authored
Merge pull request #439 from Csantucci/Missing-null-check-fix
Bug fix for https://bugs.launchpad.net/or/+bug/1935997 Missing null check
2 parents 99b646c + f64b37b commit 126e440

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/RunActivity/Viewer3D/RollingStock/MSTSWagonViewer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ private void UpdateAnimation(RenderFrame frame, ElapsedTime elapsedTime)
747747
TrainCarShape.XNAMatrices[p.iMatrix] = Car.VibrationInverseMatrix * m;
748748
}
749749

750-
if (MSTSWagon.Train.IsPlayerDriven && !Car.Simulator.Settings.SimpleControlPhysics)
750+
if ((MSTSWagon.Train?.IsPlayerDriven ?? false) && !Car.Simulator.Settings.SimpleControlPhysics)
751751
{
752752
UpdateCouplers(frame, elapsedTime);
753753
}

0 commit comments

Comments
 (0)