From 39b165f6c7596194016288e911abd137ec90aa9c Mon Sep 17 00:00:00 2001 From: FrederikJA Date: Fri, 23 Jan 2026 15:02:58 +0100 Subject: [PATCH] Fix null reference exception in python discoverer --- OpenTap.Python/PythonInstallationDiscoverer.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenTap.Python/PythonInstallationDiscoverer.cs b/OpenTap.Python/PythonInstallationDiscoverer.cs index d3bed78..babf6b9 100644 --- a/OpenTap.Python/PythonInstallationDiscoverer.cs +++ b/OpenTap.Python/PythonInstallationDiscoverer.cs @@ -49,6 +49,9 @@ static bool GetVersion(string libPath, out int major, out int minor) var sh = SharedLib.Load(libPath); + if (sh is null) + return false; + var versionSymbol = sh.GetSymbol("Py_GetVersion"); if (versionSymbol == IntPtr.Zero) return false;