Skip to content

Commit f64b37b

Browse files
committed
refactor: use nullable for null check
1 parent 938e413 commit f64b37b

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 != null && 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)