Removed some null props

This commit is contained in:
Chomp
2025-07-20 22:53:11 +01:00
parent e902447b89
commit 4b12fb98f3
2 changed files with 8 additions and 8 deletions
@@ -581,8 +581,8 @@ public class BotGeneratorHelper(
}
// Get container details from db
var (key, value) = itemHelper.GetItem(container.Template);
if (!key)
var (isValidItem, itemDbDetails) = itemHelper.GetItem(container.Template);
if (!isValidItem)
{
logger.Warning(
serverLocalisationService.GetText(
@@ -595,7 +595,7 @@ public class BotGeneratorHelper(
continue;
}
if (value?.Properties?.Grids?.Count == 0)
if (itemDbDetails?.Properties?.Grids?.Count == 0)
// Container has no slots to hold items
{
continue;
@@ -610,8 +610,8 @@ public class BotGeneratorHelper(
// Iterate over each grid in the container and look for a big enough space for the item to be placed in
var currentGridCount = 1;
var totalSlotGridCount = value?.Properties?.Grids?.Count;
foreach (var slotGrid in value?.Properties?.Grids ?? [])
var totalSlotGridCount = itemDbDetails?.Properties?.Grids?.Count;
foreach (var slotGrid in itemDbDetails?.Properties?.Grids ?? [])
{
// Grid is empty, skip or item size is bigger than grid
if (
@@ -9,11 +9,11 @@ public record Bots
public Dictionary<string, object>? ExtensionData { get; set; }
[JsonPropertyName("types")]
public Dictionary<string, BotType?>? Types { get; set; }
public Dictionary<string, BotType?> Types { get; set; }
[JsonPropertyName("base")]
public BotBase? Base { get; set; }
public BotBase Base { get; set; }
[JsonPropertyName("core")]
public Dictionary<string, object>? Core { get; set; }
public Dictionary<string, object> Core { get; set; }
}