From 81d58020928228c2730bd0b95722e49c8283fd16 Mon Sep 17 00:00:00 2001 From: glax Date: Mon, 31 Jul 2023 23:03:46 +0200 Subject: [PATCH] MangaKatana fix bug where empty result in search would crash program --- Tranga/Connectors/MangaKatana.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tranga/Connectors/MangaKatana.cs b/Tranga/Connectors/MangaKatana.cs index e5cec4d..6c7179d 100644 --- a/Tranga/Connectors/MangaKatana.cs +++ b/Tranga/Connectors/MangaKatana.cs @@ -48,6 +48,8 @@ public class MangaKatana : Connector HtmlDocument document = new(); document.LoadHtml(htmlString); IEnumerable searchResults = document.DocumentNode.SelectNodes("//*[@id='book_list']/div"); + if (searchResults is null || !searchResults.Any()) + return Array.Empty(); List urls = new(); foreach (HtmlNode mangaResult in searchResults) {