Skip to content

Commit

Permalink
Improved BAML connection id analysis when dependencies are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
ElektroKill committed Sep 19, 2023
1 parent 8355a6a commit cac9f42
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void Callback(XamlContext ctx, XElement elem) {
}

struct EventAttachment {
public TypeDef AttachedType;
public ITypeDefOrRef AttachedType;
public string EventName;
public string MethodName;

Expand Down Expand Up @@ -216,7 +216,7 @@ Dictionary<int, Action<XamlContext, XElement>> ExtractConnectionId(XamlContext c
evName = evName.Substring(0, evName.Length - 5);

cb += new EventAttachment {
AttachedType = reField.DeclaringType.ResolveTypeDefThrow(),
AttachedType = reField.DeclaringType.ResolveTypeDef() ?? reField.DeclaringType,
EventName = evName,
MethodName = IdentifierEscaper.Escape(handler.Name)
}.Callback;
Expand Down

0 comments on commit cac9f42

Please sign in to comment.