Fixed crash in wglShareList.
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index d3bff02..f38a218 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -560,7 +560,7 @@
 
   TRACE("(%p, %p)\n", org, dest);
 
-  if (dest->ctx != NULL) {
+  if (NULL != dest && dest->ctx != NULL) {
     ERR("Could not share display lists, context already created !\n");
     return FALSE;
   } else {
@@ -570,15 +570,16 @@
       LEAVE_GL();
       TRACE(" created a delayed OpenGL context (%p) for Wine context %p\n", org->ctx, org);
     }
-
-    ENTER_GL();
-    /* Create the destination context with display lists shared */
-    dest->ctx = glXCreateContext(org->display, dest->vis, org->ctx, True);
-    LEAVE_GL();
-    TRACE(" created a delayed OpenGL context (%p) for Wine context %p sharing lists with OpenGL ctx %p\n", dest->ctx, dest, org->ctx);
+    if (NULL != dest) {
+      ENTER_GL();
+      /* Create the destination context with display lists shared */
+      dest->ctx = glXCreateContext(org->display, dest->vis, org->ctx, True);
+      LEAVE_GL();
+      TRACE(" created a delayed OpenGL context (%p) for Wine context %p sharing lists with OpenGL ctx %p\n", dest->ctx, dest, org->ctx);
+      return TRUE;
+    }
   }
-
-  return TRUE;
+  return FALSE;
 }
 
 /***********************************************************************