Skip to content

Commit ea21db1

Browse files
committed
chore: refactor nullchecks
1 parent 39ab06a commit ea21db1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Yafc/Workspace/ProductionTable/ProductionTableView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ async void addRecipe(Recipe rec) {
691691
var selectFuel = type != ProductDropdownType.Fuel ? null : (Action<Goods>)(fuel => {
692692
recipe.RecordUndo().fuel = fuel;
693693
});
694-
var allProduction = goods == null ? Array.Empty<Recipe>() : variants == null ? goods.production : variants.SelectMany(x => x.production).Distinct().ToArray();
694+
Recipe[] allProduction = variants?.SelectMany(x => x.production).Distinct().ToArray() ?? goods?.production ?? [];
695695
var fuelDisplayFunc = recipe?.entity?.energy.type == EntityEnergyType.FluidHeat
696696
? (Func<Goods, string>)(g => DataUtils.FormatAmount(g.fluid?.heatValue ?? 0, UnitOfMeasure.Megajoule))
697697
: g => DataUtils.FormatAmount(g.fuelValue, UnitOfMeasure.Megajoule);

0 commit comments

Comments
 (0)