From 54417115f368d15144261f34c32cc81543168ad0 Mon Sep 17 00:00:00 2001 From: qianlifeng Date: Sun, 13 Apr 2014 01:07:15 +0800 Subject: [PATCH] Fix python plugin crash issues. --- Pythonnet.Runtime/genericutil.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Pythonnet.Runtime/genericutil.cs b/Pythonnet.Runtime/genericutil.cs index c3de0aa56..92751add7 100644 --- a/Pythonnet.Runtime/genericutil.cs +++ b/Pythonnet.Runtime/genericutil.cs @@ -38,6 +38,9 @@ namespace Python.Runtime { internal static void Register(Type t) { Dictionary> nsmap = null; + //for Anonymous type, there is no namespace + if (t.Namespace == null) return; + mapping.TryGetValue(t.Namespace, out nsmap); if (nsmap == null) { nsmap = new Dictionary>();