You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I create a new Github client, I get this message: The object reference was not set to an object instance.
Versions
Octokit c# .net 13.0.1
Relevant log output
I created the following code:
private static async Task<Release>GetLatestReleaseVersion()
{
LogMessage("Erstelle GitHub-Client und prüfe auf Releases...");
var client = new GitHubClient(new ProductHeaderValue("TestProject"));if (!string.IsNullOrEmpty(GithubToken))
{
LogMessage("Setze GitHub Token.");
var tokenAuth = new Credentials(GithubToken);
client.Credentials = tokenAuth;
}
var rateLimit = await client.RateLimit.GetRateLimits();
LogMessage($"Rate Limit: {rateLimit.Rate.Remaining}/{rateLimit.Rate.Limit}");
LogMessage("Versuche, alle Releases abzurufen...");
var releases = await client.Repository.Release.GetAll(GitHubOwner, GitHubRepo);if (releases == null ||!releases.Any())
{
LogMessage("Fehler: Keine Releases gefunden.");
throw new InvalidOperationException("Keine Releases gefunden.");
}
var latestRelease = releases.FirstOrDefault();
if (latestRelease == null)
{
LogMessage("Fehler: Kein Release gefunden.");
throw new InvalidOperationException("Kein Release gefunden.");
}
LogMessage($"Gefundenes Release: {latestRelease.TagName}");return latestRelease;
}
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
What happened?
When I create a new Github client, I get this message: The object reference was not set to an object instance.
Versions
Octokit c# .net 13.0.1
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: