null guard and fix ctor

This commit is contained in:
CWX
2025-01-24 18:23:04 +00:00
parent 267c647cbb
commit 5a8e2a5d3c
2 changed files with 3 additions and 6 deletions
@@ -40,7 +40,7 @@ public class RepairController(
body.TId,
output);
if (output.Warnings.Count > 0)
if (output.Warnings?.Count > 0)
{
return output;
}
+2 -5
View File
@@ -20,7 +20,7 @@ namespace Core.Services;
[Injectable(InjectionType.Singleton)]
public class RepairService(
ISptLogger<RepairService> _logger,
RandomUtil randomUtil,
RandomUtil _randomUtil,
DatabaseService _databaseService,
ItemHelper _itemHelper,
TraderHelper _traderHelper,
@@ -31,10 +31,7 @@ public class RepairService(
ConfigServer _configServer,
WeightedRandomHelper _weightedRandomHelper)
{
private readonly ISptLogger<RepairService> _logger;
private readonly RandomUtil _randomUtil;
private readonly WeightedRandomHelper _weightedRandomHelper;
private readonly RepairConfig _repairConfig = _configServer.GetConfig<RepairConfig>();
protected RepairConfig _repairConfig = _configServer.GetConfig<RepairConfig>();
/// <summary>