From f51a54cbce99f0e07ddb97bcacb35c94895aa598 Mon Sep 17 00:00:00 2001 From: James Ross Date: Thu, 30 Jan 2020 21:21:27 +0000 Subject: [PATCH] fix: Allow for missing data when accounts have been deleted --- Program.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Program.cs b/Program.cs index bcb9c6e..7b93b3f 100644 --- a/Program.cs +++ b/Program.cs @@ -63,11 +63,11 @@ static async Task AsyncMain(IConfigurationRoot config) Console.WriteLine($"Open pull requests ({pullRequests.Count}):"); foreach (var pullRequest in pullRequests) { - var autoMerge = memberLogins.Contains(pullRequest.Author.Login) + var autoMerge = memberLogins.Contains(pullRequest.Author?.Login) && !pullRequest.Labels.Nodes.Any(label => label.Name == gitHubConfig["excludeLabel"]); Console.WriteLine($" #{pullRequest.Number} {pullRequest.Title}"); - Console.WriteLine($" By: {pullRequest.Author.Login}"); - Console.WriteLine($" Branch: {pullRequest.HeadRef.Name}"); + Console.WriteLine($" By: {pullRequest.Author?.Login}"); + Console.WriteLine($" Branch: {pullRequest.HeadRef?.Name}"); Console.WriteLine($" Labels: {String.Join(' ', pullRequest.Labels.Nodes.Select(label => label.Name))}"); Console.WriteLine($" Allowed to auto-merge? {autoMerge}"); if (autoMerge)