Fixed potential NRE during extension loading.

This commit is contained in:
the_fiddler 2009-05-11 10:31:50 +00:00
parent 57bd7e623e
commit 6a17953ba0

View file

@ -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);