From d62bf415f0ff3acb6bef1cfca36605cc12a6c6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Thu, 12 Feb 2015 11:35:18 -0800 Subject: [PATCH] Fail early in case there is no display --- platform/default/headless_view.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/default/headless_view.cpp b/platform/default/headless_view.cpp index 5f41994c2..975e7f58f 100644 --- a/platform/default/headless_view.cpp +++ b/platform/default/headless_view.cpp @@ -100,6 +100,10 @@ void HeadlessView::loadExtensions() { } void HeadlessView::createContext() { + if (!display_) { + throw std::runtime_error("Display is not set"); + } + #if MBGL_USE_CGL CGLError error = CGLCreateContext(display_->pixelFormat, NULL, &glContext); if (error != kCGLNoError) {