Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 878d114

Browse files
committed
Fix: NullReferenceException when XAML file contains an XML declaration (<?xml ... ?>) and mouse cursor is moved over it.
1 parent 550fe0f commit 878d114

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlAstResolver.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ ResolveResult ResolveText(AXmlText text, CancellationToken cancellationToken)
9393
return new TypeResolveResult(type);
9494
}
9595
}
96+
if (attribute.ParentElement == null)
97+
return ErrorResolveResult.UnknownError;
98+
9699
string propertyName = attribute.LocalName;
97100
if (propertyName.Contains(".")) {
98101
string namespaceName = string.IsNullOrEmpty(attribute.Namespace) ? attribute.ParentElement.LookupNamespace("") : attribute.Namespace;

0 commit comments

Comments
 (0)