Skip to content

Commit

Permalink
Bugfix/nre (#195)
Browse files Browse the repository at this point in the history
* Something is null

* Update build.yaml

* stupid nre

* More nulls
  • Loading branch information
SteveSyfuhs authored Sep 24, 2020
1 parent 9b0ed73 commit e1ad489
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Kerberos.NET/CommandLine/KerberosListCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private async Task GetServiceTicket(KerberosClient client)
}
catch (AggregateException aex)
{
ICollection<Exception> exceptions = aex.InnerExceptions;
ICollection<Exception> exceptions = aex.InnerExceptions?.Where(e => e != null)?.ToList();

if (exceptions == null)
{
Expand All @@ -100,16 +100,16 @@ private async Task GetServiceTicket(KerberosClient client)
}
}

foreach (var kex in exceptions.OfType<KerberosProtocolException>())
foreach (var ex in exceptions.Where(e => e != null))
{
if (kex.Error.ErrorCode == KerberosErrorCode.KRB_AP_ERR_TKT_EXPIRED)
if (ex is KerberosProtocolException kex && kex?.Error.ErrorCode == KerberosErrorCode.KRB_AP_ERR_TKT_EXPIRED)
{
await PurgeTickets();
await client.GetServiceTicket(this.ServicePrincipalName);
break;
}

this.IO.Writer.WriteLine(kex.Message);
this.IO.Writer.WriteLine(ex?.Message ?? SR.Resource("Unknown Error"));
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ steps:
codeCoverageTool: Cobertura
summaryFileLocation: $(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml

- task: NuGetAuthenticate@0
displayName: 'NuGet Authenticate'
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
publishVstsFeed: 'Kerberos.NET/kerberos.net'
allowPackageConflicts: true

- publish: artifacts
displayName: Publish build packages
artifact: BuildPackages

0 comments on commit e1ad489

Please sign in to comment.