I don't really understand why everything is fine in the if block, even if textboh null, but the same conditions but entering the else block cause an error
private async void OpenBug()
{
    if (File.ReadLines("Response.json").First() == null)
    {
        HttpClient _client = new HttpClient();
        HttpResponseMessage response = new HttpResponseMessage();
        var authstring = "auth";
        _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authstring);
        var confSearch = await _client.GetAsync("get");
        var json = await confSearch.Content.ReadAsStringAsync();
        dynamic media = JObject.Parse(json);
        string total = media.total;
        string fileName = "Response.json";
        File.WriteAllText(fileName, total);
        string readtotal = File.ReadLines(fileName).First();
        OpenBugs.Text = readtotal;
    }
    else
    {
        string fileName = "Response.json";
        string readtotal = File.ReadLines(fileName).First();
        OpenBugs.Text = readtotal;
    }
}
I tried doing additional if with String.IsNullOrWhiteSpace and String.IsNullOrEmpty in the else block, but it doesn't help
 
    