xlib: Don't crash just because the display doesn't expose RANDR

If this happens, XRRGetScreenResources will return NULL, so just treat
that like nothing happened.

https://bugzilla.gnome.org/show_bug.cgi?id=699431

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 57a79912ac70080a2f9cbe65181a25b00bf1192a)
This commit is contained in:
Adam Jackson 2013-05-01 19:26:06 -04:00 committed by Robert Bragg
parent 74b8cc3acb
commit c08fe74cd0

View File

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