Skip to content

Commit

Permalink
Merge pull request #22 from PJB3005/24-06-12-hotfix-hotfix
Browse files Browse the repository at this point in the history
Fix new issue with hotfix
  • Loading branch information
juliangiebel authored Jun 12, 2024
2 parents 824cd50 + c5e0a64 commit 9f20a07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions SS14.MapServer/Controllers/GitHubWebhookController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ private async Task<IEnumerable<string>> CheckFiles(long installationId, long rep
private async Task CreateInitialPrComment(PullRequestEventPayload payload, GitReference baseCommit, List<string?> files)
{
// ReSharper disable once MethodHasAsyncOverload
var prComment = _context.PullRequestComment?.Find(
baseCommit.User.Login,
baseCommit.Repository.Name,
payload.PullRequest.Number);
var prComment = await _context.PullRequestComment.SingleOrDefaultAsync(
prc => prc.Owner == baseCommit.User.Login
&& prc.Repository == baseCommit.Repository.Name
&& prc.IssueNumber == payload.PullRequest.Number);

if (prComment != null)
return;
Expand Down Expand Up @@ -250,10 +250,10 @@ private async Task OnPrProcessingResult(IServiceProvider serviceProvider, MapPro
}

// ReSharper disable once MethodHasAsyncOverload
var prComment = _context.PullRequestComment?.Find(
pullRequest.Base.User.Login,
pullRequest.Base.Repository.Name,
pullRequest.Number);
var prComment = await _context.PullRequestComment.SingleOrDefaultAsync(
prc => prc.Owner == pullRequest.Base.User.Login
&& prc.Repository == pullRequest.Base.Repository.Name
&& prc.IssueNumber == pullRequest.Number);

var issue = new IssueIdentifier(
pullRequest.Base.User.Login,
Expand Down Expand Up @@ -293,7 +293,7 @@ private void SavePrComment(long? commentId, IssueIdentifier issue)
IssueNumber = issue.IssueId,
CommentId = commentId.Value
};
_context.PullRequestComment?.Add(prComment);
_context.PullRequestComment.Add(prComment);
_context.SaveChanges();
}

Expand Down
2 changes: 1 addition & 1 deletion SS14.MapServer/Models/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Context : DbContext
public DbSet<ImageFile>? Image { get; set; }
public DbSet<Grid>? Grid { get; set; }

public DbSet<PullRequestComment>? PullRequestComment { get; set; }
public DbSet<PullRequestComment> PullRequestComment { get; set; } = default!;

public Context(DbContextOptions<Context> options) : base(options) {}

Expand Down

0 comments on commit 9f20a07

Please sign in to comment.