From e11ee4dafe9f136dce9d0d28c2c48200eb2aa178 Mon Sep 17 00:00:00 2001 From: glax Date: Thu, 4 Jan 2024 17:04:08 +0100 Subject: [PATCH] Fixes #98 VolumeNumber can not be null for comparison --- Tranga/Chapter.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tranga/Chapter.cs b/Tranga/Chapter.cs index ed45811..8e63306 100644 --- a/Tranga/Chapter.cs +++ b/Tranga/Chapter.cs @@ -12,7 +12,7 @@ public readonly struct Chapter : IComparable // ReSharper disable once MemberCanBePrivate.Global public Manga parentManga { get; } public string? name { get; } - public string? volumeNumber { get; } + public string volumeNumber { get; } public string chapterNumber { get; } public string url { get; } // ReSharper disable once MemberCanBePrivate.Global @@ -24,12 +24,12 @@ public readonly struct Chapter : IComparable { this.parentManga = parentManga; this.name = name; - this.volumeNumber = volumeNumber; + this.volumeNumber = volumeNumber ?? "0"; this.chapterNumber = chapterNumber; this.url = url; string chapterName = string.Concat(LegalCharacters.Matches(name ?? "")); - string volStr = this.volumeNumber is not null ? $"Vol.{this.volumeNumber} " : ""; + string volStr = volumeNumber is not null ? $"Vol.{volumeNumber} " : ""; string chNumberStr = $"Ch.{chapterNumber} "; string chNameStr = chapterName.Length > 0 ? $"- {chapterName}" : ""; chNameStr = IllegalStrings.Replace(chNameStr, "");