From c87993d66e6f9120627f643806b8668a13104160 Mon Sep 17 00:00:00 2001 From: LordZero25 Date: Sat, 30 Jun 2018 07:42:51 +0800 Subject: [PATCH] Added header --- src/syosetuDownloader/Syousetsu.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/syosetuDownloader/Syousetsu.cs b/src/syosetuDownloader/Syousetsu.cs index 58e3588..24892e3 100644 --- a/src/syosetuDownloader/Syousetsu.cs +++ b/src/syosetuDownloader/Syousetsu.cs @@ -235,6 +235,8 @@ private static HtmlDocument GetPage(string link, CookieContainer cookies) public static string GetNovelHeader(HtmlDocument doc, Constants.FileType fileType) { HtmlNode headerNode = doc.DocumentNode.SelectSingleNode("//div[@id='novel_p']"); + if (headerNode == null) { return String.Empty; } + if (fileType == Constants.FileType.Text) { string s = headerNode.InnerText; @@ -255,9 +257,10 @@ public static string GetNovelHeader(HtmlDocument doc, Constants.FileType fileTyp sb.AppendLine("
"); return sb.ToString(); + }else + { + return String.Empty; } - - return String.Empty; } public static bool IsValid(HtmlDocument doc)