Skip to content

Commit

Permalink
Fix exception in tank type fallback logic
Browse files Browse the repository at this point in the history
  • Loading branch information
siimav committed Aug 31, 2024
1 parent fde0da4 commit 9e7cc8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Tanks/ModuleFuelTanks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ private void UpdateTankType (bool initializeAmounts = false)
if (!MFSSettings.tankDefinitions.TryGetValue(type, out TankDefinition def))
{
string msg = $"[ModuleFuelTanks] Tried to set tank type to {type} but it has no definition.";
if (!MFSSettings.tankDefinitions.TryGetValue(oldType, out def))
if (oldType == null || !MFSSettings.tankDefinitions.TryGetValue(oldType, out def))
{
def = typesAvailable.First();
}
Expand Down

0 comments on commit 9e7cc8f

Please sign in to comment.