From fec970d7d681bc4e3f3db6a84644fd94b9f07159 Mon Sep 17 00:00:00 2001 From: glax Date: Tue, 10 Oct 2023 22:43:34 +0200 Subject: [PATCH] #64 fix empty search --- Tranga/MangaConnectors/Bato.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tranga/MangaConnectors/Bato.cs b/Tranga/MangaConnectors/Bato.cs index d62670e..ae525fe 100644 --- a/Tranga/MangaConnectors/Bato.cs +++ b/Tranga/MangaConnectors/Bato.cs @@ -53,6 +53,8 @@ public class Bato : MangaConnector private Manga[] ParsePublicationsFromHtml(HtmlDocument document) { HtmlNode mangaList = document.DocumentNode.SelectSingleNode("//div[@data-hk='0-0-2']"); + if (!mangaList.ChildNodes.Any(node => node.Name == "div")) + return Array.Empty(); List urls = mangaList.ChildNodes .Select(node => $"https://bato.to{node.Descendants("div").First().FirstChild.GetAttributeValue("href", "")}").ToList();