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) {