Skip to content

Commit fecb56f

Browse files
committed
Null pointer check
1 parent b79f408 commit fecb56f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies/Controllers/PantographSelector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void InitializeMoving()
146146

147147
public void Save(BinaryWriter outf)
148148
{
149-
outf.Write(Position.Name);
149+
outf.Write(Position?.Name);
150150
}
151151

152152
public void Restore(BinaryReader inf)

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies/Controllers/PowerLimitationSelector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void InitializeMoving()
148148

149149
public void Save(BinaryWriter outf)
150150
{
151-
outf.Write(Position.Name);
151+
outf.Write(Position?.Name);
152152
}
153153

154154
public void Restore(BinaryReader inf)

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies/Controllers/VoltageSelector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public void InitializeMoving()
149149

150150
public void Save(BinaryWriter outf)
151151
{
152-
outf.Write(Position.Name);
152+
outf.Write(Position?.Name);
153153
}
154154

155155
public void Restore(BinaryReader inf)

0 commit comments

Comments
 (0)