summaryrefslogtreecommitdiffstats
path: root/src/egl/main/egldisplay.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/main/egldisplay.c')
-rw-r--r--src/egl/main/egldisplay.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c
index 540efd4fee5..47a2323eafb 100644
--- a/src/egl/main/egldisplay.c
+++ b/src/egl/main/egldisplay.c
@@ -68,8 +68,9 @@ _EGLDisplay *
_eglLookupDisplay(EGLDisplay dpy)
{
EGLuint key = (EGLuint) dpy;
- _EGLDisplay *d = (_EGLDisplay *) _eglHashLookup(_eglGlobal.Displays, key);
- return d;
+ if (!_eglGlobal.Displays)
+ return NULL;
+ return (_EGLDisplay *) _eglHashLookup(_eglGlobal.Displays, key);
}