Migitated some null risks

This commit is contained in:
schnulller
2022-06-19 01:58:07 +02:00
parent 4f7f3b5d46
commit d8a4fe7790
11 changed files with 30 additions and 29 deletions

View File

@@ -33,7 +33,7 @@ public class LinkHelper {
reader.Tag += OnTag;
}
private void OnTag(object _, Tag tag) {
private void OnTag(object? _, Tag tag) {
if (tag.Name == "wwwlink" || tag.Name == "intlink" || tag.Name == "link") {
if (tag.EndTag && _followlinksinthis) {
_sb.Append(HTMLHelpers.TagHelpers.CreateEndElement("a"));
@@ -68,7 +68,7 @@ public class LinkHelper {
}
}
if (tag.Name == "link" && tag.Values != null) {
Comment comment = null;
Comment? comment = null;
if (tag.Values.ContainsKey("subref") && _lib.SubCommentsByID.ContainsKey(tag["subref"]))
comment = _lib.SubCommentsByID[tag["subref"]];
else if (tag.Values.ContainsKey("ref"))