mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-29 16:11:05 +01:00
Merge pull request #1333 from tgstation/FixANullRef
Fix a null reference exception when test merging
This commit is contained in:
@@ -287,7 +287,12 @@ namespace Tgstation.Server.Host.Components.Repository
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
testMergeParameters.TargetCommitSha = libGitRepo.Lookup(testMergeParameters.TargetCommitSha ?? localBranchName).Sha;
|
||||
var objectName = testMergeParameters.TargetCommitSha ?? localBranchName;
|
||||
var gitObject = libGitRepo.Lookup(objectName);
|
||||
if (gitObject == null)
|
||||
throw new JobException($"Could not find object to merge: {objectName}");
|
||||
|
||||
testMergeParameters.TargetCommitSha = gitObject.Sha;
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user