Skip to content

Commit

Permalink
Changed default fuel type override to NONE
Browse files Browse the repository at this point in the history
Fixed crash if no manufacturer was selected
  • Loading branch information
sushiat committed Nov 23, 2023
1 parent 854ad29 commit 9cb614e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions OpenSky.Agent/Views/Models/AircraftTypesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public class AircraftTypesViewModel : ViewModel
/// The override fuel type.
/// </summary>
/// -------------------------------------------------------------------------------------------------
private FuelType overrideFuelType;
private FuelType overrideFuelType = FuelType.NotUsed;

/// -------------------------------------------------------------------------------------------------
/// <summary>
Expand Down Expand Up @@ -1215,7 +1215,7 @@ private void AddAircraftType()
IsGearRetractable = this.Simulator.AircraftIdentity.GearRetractable,
Name = this.Name,
VersionNumber = this.VersionNumber,
ManufacturerID = this.SelectedManufacturer.Id,
ManufacturerID = this.SelectedManufacturer?.Id,
Category = this.Category,
IsVanilla = this.IsVanilla,
IncludeInWorldPopulation = this.IncludeInWorldPopulation,
Expand Down Expand Up @@ -1321,6 +1321,7 @@ private void CancelAddAircraft()
this.MaximumPrice = 0;
this.MinimumRunwayLength = 0;
this.Comments = null;
this.OverrideFuelType = FuelType.NotUsed;

this.aircraftTypeBeingUpdated = null;
}
Expand Down
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Version 0.5.3 (ALPHA5)
--------------------------------------------------------------------------------------
- Improved aircraft type updates, next version and variants updated automatically
in improved API method
- Changed default fuel type override to NOT USED
- Fixed crash if no manufacturer was selected

--------------------------------------------------------------------------------------
Version 0.5.2 (ALPHA5)
Expand Down

0 comments on commit 9cb614e

Please sign in to comment.