Index: dlls/wined3d/surface.c
===================================================================
RCS file: /home/wine/wine/dlls/wined3d/surface.c,v
retrieving revision 1.89
diff -u -r1.89 surface.c
--- dlls/wined3d/surface.c	6 Jul 2006 11:11:09 -0000	1.89
+++ dlls/wined3d/surface.c	7 Jul 2006 05:10:08 -0000
@@ -539,7 +539,7 @@
 
             /* NOTE: In a shared context environment the renderTarget will use the same context as the implicit swapchain (we're not in a shared environment yet! */
             if ((swapchain == targetSwapChain && targetSwapChain != NULL) || iface == myDevice->renderTarget) {
-                    if (iface == swapchain->frontBuffer) {
+                    if (swapchain && iface == swapchain->frontBuffer) {
                         TRACE("locking front\n");
                         glReadBuffer(GL_FRONT);
                     }
