Open anrouxel opened 3 months ago
Are you actually calling Repository.GetAllLanguages()
without giving any arguments for the repository? I'm unable to reproduce this with the following code on the latest main branch release:
var client = new GitHubClient(new ProductHeaderValue("MyApp"));
var languages = await client.Repository.GetAllLanguages("octokit", "octokit.net");
foreach (var language in languages)
{
Console.WriteLine($"{language.Name}: {language.NumberOfBytes}");
}
This prints the following:
C#: 10195466
PowerShell: 8539
Dockerfile: 637
Shell: 442
Hi @kfcampbell , I use Octokit.Reactive and not Octokit.
using Octokit;
using Octokit.Reactive;
class Program
{
static string owner = "anrouxel";
static string name = "MedicApp";
static ObservableGitHubClient client = new ObservableGitHubClient(new ProductHeaderValue("ophion"));
static void Main(string[] args)
{
// fetch all open pull requests
client.Repository.GetAllLanguages(owner, name)
.Subscribe(data =>
{
Console.WriteLine("Language: ", data.Name);
},
ex =>
{
Console.WriteLine("Exception found: " + ex.ToString());
});
// this will take a while, let's wait for user input before exiting
Console.ReadLine();
}
}
Can you please reduce the snippet to something similar to what I gave above? As presented, it's not runnable for me.
I've reduced the snippet.
What happened?
When calling Repository.GetAllLanguages() on anrouxel/MedicApp. I'm getting a
System.NullReferenceException: Object reference not set to an instance of an object
.Versions
Octokit.Reactive : 13.0.0
Relevant log output
Code of Conduct