Skip to content

Commit 4cb5c77

Browse files
committed
fix: Do not crash if the environment file does not have any sky satellites
1 parent 9317f8c commit 4cb5c77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/Orts.Formats.Msts/EnvironmentFile.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public EnvironmentFile(string filePath)
4949
}
5050
}
5151

52-
public SkySatellite Sun => SkySatellites.FirstOrDefault(s => s.Type == SkySatellite.SkySatelliteType.Sun);
52+
public SkySatellite Sun => SkySatellites?.FirstOrDefault(s => s.Type == SkySatellite.SkySatelliteType.Sun);
5353

5454
public class WaterLayer
5555
{

0 commit comments

Comments
 (0)