This property is meant to be nullable

This commit is contained in:
Jordan Dominion
2023-12-19 22:24:32 -05:00
parent b06be253de
commit d58ef02d31
2 changed files with 8 additions and 11 deletions
@@ -488,10 +488,11 @@ namespace Tgstation.Server.Host.Components.Deployment
repository.RemoteRepositoryName,
localCommitExistsOnRemote);
var compileJob = new Models.CompileJob(job, revisionInformation, engineLock.Version.ToString(), repository.Origin.ToString())
var compileJob = new Models.CompileJob(job, revisionInformation, engineLock.Version.ToString())
{
DirectoryName = Guid.NewGuid(),
DmeName = dreamMakerSettings.ProjectName,
RepositoryOrigin = repository.Origin.ToString(),
};
progressReporter.StageName = "Creating remote deployment notification";
+6 -10
View File
@@ -50,7 +50,7 @@ namespace Tgstation.Server.Host.Models
/// <summary>
/// The origin <see cref="Uri"/> of the repository the compile job was built from.
/// </summary>
public string RepositoryOrigin { get; set; }
public string? RepositoryOrigin { get; set; }
/// <summary>
/// The source GitHub repository the deployment came from if any.
@@ -86,7 +86,7 @@ namespace Tgstation.Server.Host.Models
/// </summary>
[Obsolete("For use by EFCore only", true)]
public CompileJob()
: this(null!, null!, null!, null!, false)
: this(null!, null!, null!, false)
{
}
@@ -96,9 +96,8 @@ namespace Tgstation.Server.Host.Models
/// <param name="job">The value of <see cref="Job"/>.</param>
/// <param name="revisionInformation">The value of <see cref="RevisionInformation"/>.</param>
/// <param name="engineVersion">The value of <see cref="EngineVersion"/>.</param>
/// <param name="repositoryOrigin">The value of <see cref="RepositoryOrigin"/>.</param>
public CompileJob(Job job, RevisionInformation revisionInformation, string engineVersion, string repositoryOrigin)
: this(job, revisionInformation, engineVersion, repositoryOrigin, true)
public CompileJob(Job job, RevisionInformation revisionInformation, string engineVersion)
: this(job, revisionInformation, engineVersion, true)
{
}
@@ -108,22 +107,19 @@ namespace Tgstation.Server.Host.Models
/// <param name="job">The value of <see cref="Job"/>.</param>
/// <param name="revisionInformation">The value of <see cref="RevisionInformation"/>.</param>
/// <param name="engineVersion">The value of <see cref="EngineVersion"/>.</param>
/// <param name="repositoryOrigin">The value of <see cref="RepositoryOrigin"/>.</param>
/// <param name="nullChecks">If <paramref name="job"/>, <paramref name="revisionInformation"/>, and <paramref name="repositoryOrigin"/> should be checked for nulls.</param>
CompileJob(Job job, RevisionInformation revisionInformation, string engineVersion, string repositoryOrigin, bool nullChecks)
/// <param name="nullChecks">If <paramref name="job"/>, <paramref name="revisionInformation"/>, and <paramref name="engineVersion"/> should be checked for nulls.</param>
CompileJob(Job job, RevisionInformation revisionInformation, string engineVersion, bool nullChecks)
{
if (nullChecks)
{
ArgumentNullException.ThrowIfNull(job);
ArgumentNullException.ThrowIfNull(revisionInformation);
ArgumentNullException.ThrowIfNull(engineVersion);
ArgumentNullException.ThrowIfNull(repositoryOrigin);
}
Job = job;
RevisionInformation = revisionInformation;
EngineVersion = engineVersion;
RepositoryOrigin = repositoryOrigin;
}
/// <inheritdoc />