From 204fb7614d29c86348f9d7dfadfe6c49efe1a31b Mon Sep 17 00:00:00 2001 From: Glax Date: Thu, 28 Nov 2024 21:35:29 +0100 Subject: [PATCH] Fix #281 Manganato errors when there is no chapters uploaded --- Tranga/MangaConnectors/Manganato.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tranga/MangaConnectors/Manganato.cs b/Tranga/MangaConnectors/Manganato.cs index 795fc8c..c3b337b 100644 --- a/Tranga/MangaConnectors/Manganato.cs +++ b/Tranga/MangaConnectors/Manganato.cs @@ -130,13 +130,13 @@ public class Manganato : MangaConnector string pattern = "MMM dd,yyyy HH:mm"; - HtmlNode oldestChapter = document.DocumentNode + HtmlNode? oldestChapter = document.DocumentNode .SelectNodes("//span[contains(concat(' ',normalize-space(@class),' '),' chapter-time ')]").MaxBy( node => DateTime.ParseExact(node.GetAttributeValue("title", "Dec 31 2400, 23:59"), pattern, - CultureInfo.InvariantCulture).Millisecond)!; + CultureInfo.InvariantCulture).Millisecond); - int year = DateTime.ParseExact(oldestChapter.GetAttributeValue("title", "Dec 31 2400, 23:59"), pattern, + int year = DateTime.ParseExact(oldestChapter?.GetAttributeValue("title", "Dec 31 2400, 23:59")??"Dec 31 2400, 23:59", pattern, CultureInfo.InvariantCulture).Year; Manga manga = new (sortName, authors.ToList(), description, altTitles, tags.ToArray(), posterUrl, coverFileNameInCache, links,