8000 Add null check to event · pythonnet/pythonnet@cc0c620 · GitHub
[go: up one dir, main page]

Skip to content

Commit cc0c620

Browse files
committed
Add null check to event
1 parent f82aeea commit cc0c620

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/runtime/ClassManager.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,12 @@ internal static bool ShouldBindProperty(PropertyInfo pi)
326326

327327
internal static bool ShouldBindEvent(EventInfo ei)
328328
{
329-
return ShouldBindMethod(ei.GetAddMethod(true));
329+
var mb = ei.GetAddMethod(true);
330+
if (mb == null)
331+
{
332+
return false;
333+
}
334+
return ShouldBindMethod(mb);
330335
}
331336

332337
private static ClassInfo GetClassInfo(Type type, ClassBase impl)

0 commit comments

Comments
 (0)
0