diff --git a/cogl/cogl-xlib-renderer.c b/cogl/cogl-xlib-renderer.c index 92f044daf..3aa70f20b 100644 --- a/cogl/cogl-xlib-renderer.c +++ b/cogl/cogl-xlib-renderer.c @@ -239,7 +239,7 @@ update_outputs (CoglRenderer *renderer, _cogl_xlib_renderer_trap_errors (renderer, &state); - for (i = 0; i < resources->ncrtc && !error; i++) + for (i = 0; resources && i < resources->ncrtc && !error; i++) { XRRCrtcInfo *crtc_info = NULL; XRROutputInfo *output_info = NULL;