Skip to content

Commit fa75a2a

Browse files
committed
Avoid ‘CS8602: Dereference of a possibly null reference’ compiler warning
1 parent 63897c0 commit fa75a2a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Extensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static IEnumerable<XmlNode> SelectNodesOrEmpty(this XmlNode node, string
3232

3333
public static void RemoveSelf(this XmlNode node)
3434
{
35-
node.ParentNode.RemoveChild(node);
35+
node.ParentNode!.RemoveChild(node);
3636
}
3737

3838
public static IImmutableDictionary<string, T> ToKeyedDictionary<T>(this IEnumerable<T>? enumerable) where T : IKeyed

modifier/ProcessorArchitecture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void SetAttribute(XmlElement element)
2525
{
2626
var copy = (XmlElement)component.CloneNode(true);
2727
SetAttribute(copy);
28-
component.ParentNode.InsertAfter(copy, component);
28+
component.ParentNode!.InsertAfter(copy, component);
2929
}
3030
}
3131
}

0 commit comments

Comments
 (0)