Nullify DreamDaemonSettings

This commit is contained in:
Jordan Dominion
2023-12-18 16:23:45 -05:00
parent dd23015f4a
commit d169c21624
2 changed files with 3 additions and 5 deletions
@@ -1,7 +1,5 @@
using System.ComponentModel.DataAnnotations;
#nullable disable
namespace Tgstation.Server.Host.Models
{
/// <inheritdoc />
@@ -21,6 +19,6 @@ namespace Tgstation.Server.Host.Models
/// The parent <see cref="Models.Instance"/>.
/// </summary>
[Required]
public Instance Instance { get; set; }
public Instance? Instance { get; set; }
}
}
@@ -74,14 +74,14 @@ namespace Tgstation.Server.Host.Utils
var ddPorts = await databaseContext
.DreamDaemonSettings
.AsQueryable()
.Where(x => x.Instance.SwarmIdentifer == swarmConfiguration.Identifier)
.Where(x => x.Instance!.SwarmIdentifer == swarmConfiguration.Identifier)
.Select(x => x.Port)
.ToListAsync(cancellationToken);
var dmPorts = await databaseContext
.DreamMakerSettings
.AsQueryable()
.Where(x => x.Instance.SwarmIdentifer == swarmConfiguration.Identifier)
.Where(x => x.Instance!.SwarmIdentifer == swarmConfiguration.Identifier)
.Select(x => x.ApiValidationPort)
.ToListAsync(cancellationToken);