Skip to content
\n\n
[INFO] - PythonEngine: Initializing Python engine.\n[ERROR]: Object reference not set to an instance of an object.\n[TRACE]:    at Python.Runtime.ClassManager.GetClassInfo(Type type, ClassBase impl)\n   at Python.Runtime.ClassManager.InitClassBase(Type type, ClassBase impl, ReflectedClrType pyType)\n   at Python.Runtime.ReflectedClrType.GetOrCreate(Type type)\n   at Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess)\n   at Python.Runtime.ModuleObject.LoadNames()\n   at Python.Runtime.ImportHook.UpdateCLRModuleDict()\n   at Python.Runtime.PythonEngine.Initialize(IEnumerable`1 args, Boolean setSysArgv, Boolean initSigs)\n   at Python.Runtime.PythonEngine.Initialize()\n   at cpGames.VSA.ToolAPI.<InitializePythonEngineAsync>d__2.MoveNext() in ToolAPI.cs:line 69 // PythonEngine.Initialize(); call\n
","upvoteCount":2,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"

Why you close my issue?

\n

Here's your fix:

\n
internal static bool ShouldBindEvent(EventInfo ei)\n        {\n            var mb = ei.GetAddMethod(true);\n            if (mb == null)\n            {\n                return false;\n            }\n            return ShouldBindMethod(mb);\n        }\n
\n

Check your nulls, thank me later.

","upvoteCount":2,"url":"https://github.com/pythonnet/pythonnet/discussions/2405#discussioncomment-9850990"}}}
Discussion options

You must be logged in to vote

Why you close my issue?

Here's your fix:

internal static bool ShouldBindEvent(EventInfo ei)
        {
            var mb = ei.GetAddMethod(true);
            if (mb == null)
            {
                return false;
            }
            return ShouldBindMethod(mb);
        }

Check your nulls, thank me later.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by cpgames
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2404 on June 23, 2024 07:54.