Null checks
This commit is contained in:
parent
81d6f268ee
commit
283001258f
@ -23,7 +23,8 @@ internal sealed class Inventory
|
|||||||
public IEnumerable<InventoryItem> GetAllItems() =>
|
public IEnumerable<InventoryItem> GetAllItems() =>
|
||||||
((IEnumerable)_getAllInventories.Invoke(_delegate, Array.Empty<object>())!)
|
((IEnumerable)_getAllInventories.Invoke(_delegate, Array.Empty<object>())!)
|
||||||
.Cast<IEnumerable>()
|
.Cast<IEnumerable>()
|
||||||
.SelectMany(x => x.Cast<object>())
|
.SelectMany(x => x.Cast<object?>())
|
||||||
.Select(x => new InventoryItem(x))
|
.Where(x => x != null)
|
||||||
|
.Select(x => new InventoryItem(x!))
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
namespace Influx.SubmarineTracker;
|
namespace Influx.SubmarineTracker;
|
||||||
|
|
||||||
public class SubmarineStats
|
public sealed class SubmarineStats
|
||||||
{
|
{
|
||||||
public string Name { get; init; }
|
public required string Name { get; init; }
|
||||||
public int Id { get; init; }
|
public required int Id { get; init; }
|
||||||
public ushort Level { get; init; }
|
public required ushort Level { get; init; }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user