From 9912691bd5796e2c0d55418072764e11a66a8a49 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Mon, 11 May 2009 10:31:50 +0000 Subject: [PATCH] Fixed potential NRE during extension loading. --- Source/OpenTK/Platform/Utilities.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/OpenTK/Platform/Utilities.cs b/Source/OpenTK/Platform/Utilities.cs index 657ac4c6..ea218a5e 100644 --- a/Source/OpenTK/Platform/Utilities.cs +++ b/Source/OpenTK/Platform/Utilities.cs @@ -158,7 +158,7 @@ namespace OpenTK.Platform Delegate old = f.GetValue(null) as Delegate; Delegate @new = LoadDelegate(f.Name, f.FieldType); - if (old.Target != @new.Target) + if ((old != null ? old.Target : null) != (@new != null ? @new.Target : null)) { f.SetValue(null, @new); FieldInfo rebuildExtensionList = type.GetField("rebuildExtensionList", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public);