From 26fac6f032a4cd2d97a4d0c160180523ae84f04c Mon Sep 17 00:00:00 2001 From: Fraser Waters Date: Fri, 28 Jul 2017 16:26:46 +0100 Subject: [PATCH] Change X11 entry assembly search and provide null fallback --- src/OpenTK/Platform/X11/X11GLNative.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/OpenTK/Platform/X11/X11GLNative.cs b/src/OpenTK/Platform/X11/X11GLNative.cs index c89883bc..fb4c9751 100644 --- a/src/OpenTK/Platform/X11/X11GLNative.cs +++ b/src/OpenTK/Platform/X11/X11GLNative.cs @@ -228,7 +228,7 @@ namespace OpenTK.Platform.X11 { foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) { - if (AppDomain.CurrentDomain.FriendlyName.EndsWith(assembly.ManifestModule.Name)) + if (assembly.ManifestModule.Name.Contains(AppDomain.CurrentDomain.FriendlyName)) { if (entry_assembly == null || assembly.ManifestModule.Name.Length > entry_assembly.ManifestModule.Name.Length) { @@ -238,7 +238,11 @@ namespace OpenTK.Platform.X11 } } - var name = entry_assembly.GetName().Name; + var name = "null"; + if (entry_assembly != null) + { + name = entry_assembly.GetName().Name; + } class_hint.Class = name; class_hint.Name = name.ToLower();