Check for egl->gbm before trying to use. am: 132d6485b1

Original change: https://android-review.googlesource.com/c/platform/external/virglrenderer/+/2975231

Change-Id: I86db68fbeb8ab14a235f746d173e9c4c9adf9534
Signed-off-by: Automerger Merge Worker <[email protected]>
diff --git a/src/vrend_winsys_egl.c b/src/vrend_winsys_egl.c
index 4b38d5e..2c14dcf 100644
--- a/src/vrend_winsys_egl.c
+++ b/src/vrend_winsys_egl.c
@@ -323,7 +323,9 @@
          egl->egl_display = get_platform_display (EGL_PLATFORM_GBM_KHR,
                                                  (EGLNativeDisplayType)egl->gbm->device, NULL);
    } else {
-      egl->egl_display = eglGetDisplay((EGLNativeDisplayType)egl->gbm->device);
+      if (egl->gbm && egl->gbm->device) {
+        egl->egl_display = eglGetDisplay((EGLNativeDisplayType)egl->gbm->device);
+      }
    }
 
    if (!egl->egl_display) {