Browse Source

Fix: NullReferenceException when XAML file contains an XML declaration (<?xml ... ?>) and mouse cursor is moved over it.

pull/375/head
Andreas Weizel 12 years ago
parent
commit
878d11481f
  1. 3
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlAstResolver.cs

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

@ -93,6 +93,9 @@ namespace ICSharpCode.XamlBinding
return new TypeResolveResult(type); return new TypeResolveResult(type);
} }
} }
if (attribute.ParentElement == null)
return ErrorResolveResult.UnknownError;
string propertyName = attribute.LocalName; string propertyName = attribute.LocalName;
if (propertyName.Contains(".")) { if (propertyName.Contains(".")) {
string namespaceName = string.IsNullOrEmpty(attribute.Namespace) ? attribute.ParentElement.LookupNamespace("") : attribute.Namespace; string namespaceName = string.IsNullOrEmpty(attribute.Namespace) ? attribute.ParentElement.LookupNamespace("") : attribute.Namespace;

Loading…
Cancel
Save